]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Cast arguments for isspace(), isascii(), and other is*() functions to int.
authorMichael Graff <mgraff@isc.org>
Mon, 1 Oct 2007 14:47:35 +0000 (14:47 +0000)
committerMichael Graff <mgraff@isc.org>
Mon, 1 Oct 2007 14:47:35 +0000 (14:47 +0000)
common/parse.c
common/print.c
minires/res_init.c

index d9f01a8ad5430cf69a8278dc51b6b68cf13b2183..01eced4ee8c433b00068f1e8b534c1e9bee8a48f 100644 (file)
@@ -343,7 +343,7 @@ int parse_ip_addr (cfile, addr)
 static int
 is_hex_string(const char *s) {
        while (*s != '\0') {
-               if (!isxdigit(*s)) {
+               if (!isxdigit((int)*s)) {
                        return 0;
                }
                s++;
@@ -4837,7 +4837,7 @@ struct option *option;
                        fmt = option->format;
 
                /* 'a' means always uniform */
-               if ((fmt[0] != '\0') && (tolower(fmt[1]) == 'a')) 
+               if ((fmt[0] != '\0') && (tolower((int)fmt[1]) == 'a')) 
                        uniform = 1;
 
                do {
index c7bad1049d9b60f096d34a27d93f23125abd818f..44e0ce15f0de5f865be59912cb2e75928267cb46 100644 (file)
@@ -45,7 +45,7 @@ char *quotify_string (const char *s, const char *file, int line)
        for (sp = s; sp && *sp; sp++) {
                if (*sp == ' ')
                        len++;
-               else if (!isascii (*sp) || !isprint (*sp))
+               else if (!isascii ((int)*sp) || !isprint ((int)*sp))
                        len += 4;
                else if (*sp == '"' || *sp == '\\')
                        len += 2;
@@ -59,7 +59,7 @@ char *quotify_string (const char *s, const char *file, int line)
                for (sp = s; sp && *sp; sp++) {
                        if (*sp == ' ')
                                *nsp++ = ' ';
-                       else if (!isascii (*sp) || !isprint (*sp)) {
+                       else if (!isascii ((int)*sp) || !isprint ((int)*sp)) {
                                sprintf (nsp, "\\%03o",
                                         *(const unsigned char *)sp);
                                nsp += 4;
index c2c744e3ff9c3ff3472fe6ca704fe97dd3867f35..b96b326bc2d9da9a8404aa5d7816f0487aab1b56 100644 (file)
@@ -76,7 +76,7 @@
 
 #if defined(LIBC_SCCS) && !defined(lint)
 static const char sccsid[] = "@(#)res_init.c   8.1 (Berkeley) 6/7/93";
-static const char rcsid[] = "$Id: res_init.c,v 1.9 2007/09/05 17:32:10 dhankins Exp $";
+static const char rcsid[] = "$Id: res_init.c,v 1.10 2007/10/01 14:47:35 explorer Exp $";
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -321,7 +321,7 @@ minires_vinit(res_state statp, int preinit) {
                            break;
                        net = cp;
                        while (*cp && !ISSORTMASK(*cp) && *cp != ';' &&
-                              isascii(*cp) && !isspace(*cp))
+                              isascii((int)*cp) && !isspace((int)*cp))
                                cp++;
                        n = *cp;
                        *cp = 0;
@@ -331,7 +331,7 @@ minires_vinit(res_state statp, int preinit) {
                                *cp++ = n;
                                net = cp;
                                while (*cp && *cp != ';' &&
-                                       isascii(*cp) && !isspace(*cp))
+                                       isascii((int)*cp) && !isspace((int)*cp))
                                    cp++;
                                n = *cp;
                                *cp = 0;