summaryrefslogtreecommitdiff
path: root/whois.c
diff options
context:
space:
mode:
authorPetr Písař <ppisar@redhat.com>2013-11-11 17:28:59 +0100
committerMarco d'Itri <md@linux.it>2013-12-26 07:48:10 +0100
commit298f2080fe7d15eace3daf705d61a56c678a9b44 (patch)
treef12ca01f8d3dc67064fd9526c724f5f287767297 /whois.c
parent4808ec3bd89325ca668a84990c9eca43b2980b86 (diff)
downloadwhois-298f2080fe7d15eace3daf705d61a56c678a9b44.tar.gz
strtol() returns signed long int
Assiging strol() return value to unsigned int makes subsequent comparison to < 0 pointless. Signed-off-by: Petr Písař <ppisar@redhat.com>
Diffstat (limited to 'whois.c')
-rw-r--r--whois.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/whois.c b/whois.c
index 7be6a13..cddacf3 100644
--- a/whois.c
+++ b/whois.c
@@ -1118,7 +1118,7 @@ char *convert_inaddr(const char *s)
{
char *new;
char *endptr;
- unsigned int a, b = 0, c = 0;
+ long int a, b = 0, c = 0;
errno = 0;
@@ -1142,7 +1142,7 @@ char *convert_inaddr(const char *s)
}
new = malloc(sizeof("255.255.255.255"));
- sprintf(new, "%d.%d.%d.0", c, b, a);
+ sprintf(new, "%ld.%ld.%ld.0", c, b, a);
return new;
}