A whole buncha unsigned char casts for ctype function arguments.
authormmcc <mmcc@openbsd.org>
Sun, 18 Oct 2015 03:04:11 +0000 (03:04 +0000)
committermmcc <mmcc@openbsd.org>
Sun, 18 Oct 2015 03:04:11 +0000 (03:04 +0000)
ok guenther@

usr.bin/ftp/cmds.c
usr.bin/ftp/complete.c
usr.bin/ftp/domacro.c
usr.bin/ftp/small.c
usr.bin/ftp/util.c

index 38ad2c1..ede6398 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: cmds.c,v 1.74 2015/01/30 04:45:45 tedu Exp $  */
+/*     $OpenBSD: cmds.c,v 1.75 2015/10/18 03:04:11 mmcc Exp $  */
 /*     $NetBSD: cmds.c,v 1.27 1997/08/18 10:20:15 lukem Exp $  */
 
 /*
@@ -279,16 +279,16 @@ usage:
                        if (mflag && confirm(argv[0], cp)) {
                                tp = cp;
                                if (mcase) {
-                                       while (*tp && !islower(*tp)) {
+                                       while (*tp && !islower((unsigned char)*tp)) {
                                                tp++;
                                        }
                                        if (!*tp) {
                                                tp = cp;
                                                tp2 = tmpbuf;
                                                while ((*tp2 = *tp) != '\0') {
-                                                    if (isupper(*tp2)) {
+                                                    if (isupper((unsigned char)*tp2)) {
                                                            *tp2 =
-                                                               tolower(*tp2);
+                                                               tolower((unsigned char)*tp2);
                                                     }
                                                     tp++;
                                                     tp2++;
index dd5c55f..5e0b00a 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: complete.c,v 1.28 2015/01/16 06:40:08 deraadt Exp $   */
+/*     $OpenBSD: complete.c,v 1.29 2015/10/18 03:04:11 mmcc Exp $      */
 /*     $NetBSD: complete.c,v 1.10 1997/08/18 10:20:18 lukem Exp $      */
 
 /*-
@@ -322,7 +322,7 @@ complete(EditLine *el, int ch)
 
                /* check for 'continuation' completes (which are uppercase) */
        if ((cursor_argc > celems) && (celems > 0)
-           && isupper(c->c_complete[celems-1]))
+           && isupper((unsigned char)c->c_complete[celems - 1]))
                cursor_argc = celems;
 
        if (cursor_argc > celems)
index 107708d..72b59b5 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: domacro.c,v 1.17 2009/05/05 19:35:30 martynas Exp $   */
+/*     $OpenBSD: domacro.c,v 1.18 2015/10/18 03:04:11 mmcc Exp $       */
 /*     $NetBSD: domacro.c,v 1.10 1997/07/20 09:45:45 lukem Exp $       */
 
 /*
@@ -65,7 +65,7 @@ domacro(int argc, char *argv[])
 TOP:
        cp1 = macros[i].mac_start;
        while (cp1 != macros[i].mac_end) {
-               while (isspace(*cp1)) {
+               while (isspace((unsigned char)*cp1)) {
                        cp1++;
                }
                cp2 = line;
@@ -75,9 +75,9 @@ TOP:
                                 *cp2++ = *++cp1;
                                 break;
                            case '$':
-                                if (isdigit(*(cp1+1))) {
+                                if (isdigit((unsigned char)*(cp1 + 1))) {
                                    j = 0;
-                                   while (isdigit(*++cp1)) {
+                                   while (isdigit((unsigned char)*++cp1)) {
                                          j = 10*j +  *cp1 - '0';
                                    }
                                    cp1--;
index 1d22d9e..23f477f 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: small.c,v 1.4 2015/01/30 04:45:45 tedu Exp $  */
+/*     $OpenBSD: small.c,v 1.5 2015/10/18 03:04:11 mmcc Exp $  */
 /*     $NetBSD: cmds.c,v 1.27 1997/08/18 10:20:15 lukem Exp $  */
 
 /*
@@ -238,15 +238,15 @@ usage:
        if (loc && mcase) {
                char *tp = argv[1], *tp2, tmpbuf[PATH_MAX];
 
-               while (*tp && !islower(*tp)) {
+               while (*tp && !islower((unsigned char)*tp)) {
                        tp++;
                }
                if (!*tp) {
                        tp = argv[2];
                        tp2 = tmpbuf;
                        while ((*tp2 = *tp) != '\0') {
-                               if (isupper(*tp2)) {
-                                       *tp2 = tolower(*tp2);
+                               if (isupper((unsigned char)*tp2)) {
+                                       *tp2 = tolower((unsigned char)*tp2);
                                }
                                tp++;
                                tp2++;
@@ -612,7 +612,7 @@ domap(char *name)
                                break;
                        case '[':
 LOOP:
-                               if (*++cp2 == '$' && isdigit(*(cp2+1))) {
+                               if (*++cp2 == '$' && isdigit((unsigned char)*(cp2 + 1))) {
                                        if (*++cp2 == '0') {
                                                char *cp3 = name;
 
@@ -637,7 +637,7 @@ LOOP:
                                                        cp2++;
                                                }
                                                else if (*cp2 == '$' &&
-                                                       isdigit(*(cp2+1))) {
+                                                       isdigit((unsigned char)*(cp2 + 1))) {
                                                        if (*++cp2 == '0') {
                                                           char *cp3 = name;
 
@@ -691,7 +691,7 @@ LOOP:
                                }
                                break;
                        case '$':
-                               if (isdigit(*(cp2 + 1))) {
+                               if (isdigit((unsigned char)*(cp2 + 1))) {
                                        if (*++cp2 == '0') {
                                                char *cp3 = name;
 
index 984bf71..7d2d9dd 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: util.c,v 1.72 2015/03/17 19:31:30 millert Exp $       */
+/*     $OpenBSD: util.c,v 1.73 2015/10/18 03:04:11 mmcc Exp $  */
 /*     $NetBSD: util.c,v 1.12 1997/08/18 10:20:27 lukem Exp $  */
 
 /*-
@@ -488,7 +488,7 @@ top:
        (void)fflush(ttyout);
        if (fgets(str, sizeof(str), stdin) == NULL)
                goto quit;
-       switch (tolower(*str)) {
+       switch (tolower((unsigned char)*str)) {
                case '?':
                        fprintf(ttyout,
                            "?  help\n"
@@ -582,7 +582,7 @@ remotesize(const char *file, int noisy)
                if (cp != NULL) {
                        cp++;
                        size = strtoq(cp, &ep, 10);
-                       if (*ep != '\0' && !isspace(*ep))
+                       if (*ep != '\0' && !isspace((unsigned char)*ep))
                                size = -1;
                }
        } else if (noisy
@@ -626,9 +626,9 @@ remotemodtime(const char *file, int noisy)
                char *timestr = reply_string;
 
                /* Repair `19%02d' bug on server side */
-               while (!isspace(*timestr))
+               while (!isspace((unsigned char)*timestr))
                        timestr++;
-               while (isspace(*timestr))
+               while (isspace((unsigned char)*timestr))
                        timestr++;
                if (strncmp(timestr, "191", 3) == 0) {
                        fprintf(ttyout,