summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mkpasswd.c5
-rw-r--r--utils.c3
-rw-r--r--whois.c11
3 files changed, 11 insertions, 8 deletions
diff --git a/mkpasswd.c b/mkpasswd.c
index e2872c7..8066c81 100644
--- a/mkpasswd.c
+++ b/mkpasswd.c
@@ -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);
diff --git a/utils.c b/utils.c
index 254bf2a..e29749e 100644
--- a/utils.c
+++ b/utils.c
@@ -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;
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;