From: Roy Marples Date: Thu, 17 Apr 2008 09:57:19 +0000 (+0000) Subject: Our ctype calls should always use unsigned. X-Git-Tag: v4.0.2~478 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2cfcde87ea8d58a44fd67cf060bdc234f900304;p=thirdparty%2Fdhcpcd.git Our ctype calls should always use unsigned. --- diff --git a/configure.c b/configure.c index abd11bbf..6554cac2 100644 --- a/configure.c +++ b/configure.c @@ -241,7 +241,7 @@ configure_routes(struct interface *iface, const struct dhcp_message *dhcp, /* Check that we did add this route or not */ sk = skp = xstrdup(dhcpcd_skiproutes); while ((token = strsep(&skp, ","))) { - if (isdigit(*token) && atoi(token) == i) + if (isdigit((unsigned)*token) && atoi(token) == i) break; } free(sk); diff --git a/if-bsd.c b/if-bsd.c index a352521d..66226b28 100644 --- a/if-bsd.c +++ b/if-bsd.c @@ -37,7 +37,6 @@ #include #include -#include #include #include #include diff --git a/if-linux.c b/if-linux.c index 6b7e902a..30b2f6e7 100644 --- a/if-linux.c +++ b/if-linux.c @@ -39,7 +39,6 @@ #include #include -#include #include #include #include diff --git a/logger.c b/logger.c index 10a829b9..bdd64cf5 100644 --- a/logger.c +++ b/logger.c @@ -47,7 +47,7 @@ logtolevel(const char *priority) { CODE *c; - if (isdigit((int)*priority)) + if (isdigit((unsigned)*priority)) return atoi(priority); for (c = prioritynames; c->c_name; c++) if (!strcasecmp(priority, c->c_name)) diff --git a/net.c b/net.c index 2c122856..e692b49b 100644 --- a/net.c +++ b/net.c @@ -154,7 +154,9 @@ hwaddr_aton(unsigned char *buffer, const char *addr) return 0; } /* Ensure that digits are hex */ - if (isxdigit ((int)c[0]) == 0 || isxdigit((int)c[1]) == 0) { + if (isxdigit((unsigned)c[0]) == 0 || + isxdigit((unsigned)c[1]) == 0) + { errno = EINVAL; return 0; }