]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Our ctype calls should always use unsigned.
authorRoy Marples <roy@marples.name>
Thu, 17 Apr 2008 09:57:19 +0000 (09:57 +0000)
committerRoy Marples <roy@marples.name>
Thu, 17 Apr 2008 09:57:19 +0000 (09:57 +0000)
configure.c
if-bsd.c
if-linux.c
logger.c
net.c

index abd11bbf264bb238e6025831d60a5a9dbd1e679a..6554cac2ebc9277edb084aaa887f1733677ff38f 100644 (file)
@@ -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);
index a352521d821eaa36036aabe5c62f87a7b852de63..66226b28ff96bef475660064281b64ad8fe1936e 100644 (file)
--- a/if-bsd.c
+++ b/if-bsd.c
@@ -37,7 +37,6 @@
 #include <net/route.h>
 #include <netinet/in.h>
 
-#include <ctype.h>
 #include <errno.h>
 #include <stddef.h>
 #include <stdio.h>
index 6b7e902a3d35997a092b56aaae5ae85666c73cad..30b2f6e74ab3e2155e1295cec4b19e1bc467a3c5 100644 (file)
@@ -39,7 +39,6 @@
 #include <netinet/ether.h>
 #include <netpacket/packet.h>
 
-#include <ctype.h>
 #include <errno.h>
 #include <stddef.h>
 #include <stdio.h>
index 10a829b99c2f8ccbddf4bcd9549237b89eb0ce3f..bdd64cf561e3a6669d7c3da4e707335742adc164 100644 (file)
--- 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 2c12285626d07cf78917eb784fd1ec639f1f7aa4..e692b49b272782e2a70bb32bf81cc4eb5dc4e39b 100644 (file)
--- 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;
                }