From 5e33209e133a0691602e3ce400d5fa893cb3b377 Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Sun, 26 Feb 2017 23:12:47 +0100 Subject: Fix minor compiler warnings Fix a lot of minor compiler warnings with no practical effect. Contributed by Sami Kerola. --- whois.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'whois.c') diff --git a/whois.c b/whois.c index 7c987ae..897a7ed 100644 --- a/whois.c +++ b/whois.c @@ -126,7 +126,8 @@ int main(int argc, char *argv[]) int longindex; #endif - int ch, nopar = 0, fstringlen = 64; + int ch, nopar = 0; + size_t fstringlen = 64; const char *server = NULL, *port = NULL; char *qstring, *fstring; int ret; @@ -1133,7 +1134,7 @@ const char *is_new_gtld(const char *s) if (in_domain(s, new_gtlds[i])) return new_gtlds[i]; - return 0; + return NULL; } /* @@ -1232,7 +1233,7 @@ void split_server_port(const char *const input, } /* change the server name to lower case */ - for (p = (char *) *server; *p && *p != '\0'; p++) + for (p = (char *) *server; *p; p++) *p = tolower(*p); } @@ -1268,7 +1269,7 @@ char *convert_6to4(const char *s) } new = malloc(sizeof("255.255.255.255")); - sprintf(new, "%d.%d.%d.%d", a >> 8, a & 0xff, b >> 8, b & 0xff); + sprintf(new, "%ud.%ud.%ud.%ud", a >> 8, a & 0xff, b >> 8, b & 0xff); #endif return new; @@ -1298,7 +1299,7 @@ char *convert_teredo(const char *s) a ^= 0xffff; b ^= 0xffff; new = malloc(sizeof("255.255.255.255")); - sprintf(new, "%d.%d.%d.%d", a >> 8, a & 0xff, b >> 8, b & 0xff); + sprintf(new, "%ud.%ud.%ud.%ud", a >> 8, a & 0xff, b >> 8, b & 0xff); #endif return new; -- cgit v1.2.3