From: mmcc Date: Sun, 18 Oct 2015 03:04:11 +0000 (+0000) Subject: A whole buncha unsigned char casts for ctype function arguments. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d76cc7f5f596b7c70a7ecfdedc0d9e99e18d3d22;p=openbsd A whole buncha unsigned char casts for ctype function arguments. ok guenther@ --- diff --git a/usr.bin/ftp/cmds.c b/usr.bin/ftp/cmds.c index 38ad2c1759c..ede6398868c 100644 --- a/usr.bin/ftp/cmds.c +++ b/usr.bin/ftp/cmds.c @@ -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++; diff --git a/usr.bin/ftp/complete.c b/usr.bin/ftp/complete.c index dd5c55f483e..5e0b00a8c9c 100644 --- a/usr.bin/ftp/complete.c +++ b/usr.bin/ftp/complete.c @@ -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) diff --git a/usr.bin/ftp/domacro.c b/usr.bin/ftp/domacro.c index 107708deb51..72b59b55b63 100644 --- a/usr.bin/ftp/domacro.c +++ b/usr.bin/ftp/domacro.c @@ -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--; diff --git a/usr.bin/ftp/small.c b/usr.bin/ftp/small.c index 1d22d9e647d..23f477f565e 100644 --- a/usr.bin/ftp/small.c +++ b/usr.bin/ftp/small.c @@ -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; diff --git a/usr.bin/ftp/util.c b/usr.bin/ftp/util.c index 984bf71beda..7d2d9dd3807 100644 --- a/usr.bin/ftp/util.c +++ b/usr.bin/ftp/util.c @@ -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,