diff options
author | Marco d'Itri <md@linux.it> | 2017-02-26 23:12:47 +0100 |
---|---|---|
committer | Marco d'Itri <md@linux.it> | 2017-02-26 23:12:47 +0100 |
commit | 5e33209e133a0691602e3ce400d5fa893cb3b377 (patch) | |
tree | b4287ac4dcf524dcbc216c3e59fe126d7341da04 | |
parent | a4815eb370626ec070b5be0fe4a901feb7c020fa (diff) | |
download | whois-5e33209e133a0691602e3ce400d5fa893cb3b377.tar.gz |
Fix minor compiler warnings
Fix a lot of minor compiler warnings with no practical effect.
Contributed by Sami Kerola.
-rw-r--r-- | mkpasswd.c | 5 | ||||
-rw-r--r-- | utils.c | 3 | ||||
-rw-r--r-- | whois.c | 11 |
3 files changed, 11 insertions, 8 deletions
@@ -151,7 +151,7 @@ int main(int argc, char *argv[]) /* prepend options from environment */ argv = merge_args(getenv("MKPASSWD_OPTIONS"), argv, &argc); - while ((ch = GETOPT_LONGISH(argc, argv, "hH:m:5P:R:sS:V", longopts, 0)) + while ((ch = GETOPT_LONGISH(argc, argv, "hH:m:5P:R:sS:V", longopts, NULL)) > 0) { switch (ch) { case '5': @@ -364,7 +364,8 @@ int main(int argc, char *argv[]) void* get_random_bytes(const unsigned int count) { char *buf; - int fd, bytes_read; + int fd; + ssize_t bytes_read; buf = NOFAIL(malloc(count)); fd = open(RANDOM_DEVICE, O_RDONLY); @@ -46,7 +46,8 @@ char **merge_args(char *args, char *argv[], int *argc) { char *arg, *argstring; char **newargs = NULL; - unsigned int i, num_env = 0; + int i; + unsigned int num_env = 0; if (!args) return argv; @@ -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; |