From 298f2080fe7d15eace3daf705d61a56c678a9b44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Mon, 11 Nov 2013 17:28:59 +0100 Subject: [PATCH] strtol() returns signed long int MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assiging strol() return value to unsigned int makes subsequent comparison to < 0 pointless. Signed-off-by: Petr Písař --- whois.c | 4 ++-- 1 file 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; }