diff options
-rw-r--r-- | usr.bin/apply/apply.c | 8 | ||||
-rw-r--r-- | usr.bin/apropos/apropos.c | 4 | ||||
-rw-r--r-- | usr.bin/at/at.c | 19 | ||||
-rw-r--r-- | usr.bin/at/parsetime.c | 12 | ||||
-rw-r--r-- | usr.bin/bdes/bdes.c | 6 | ||||
-rw-r--r-- | usr.bin/bgplg/bgplg.c | 11 | ||||
-rw-r--r-- | usr.bin/bgplg/bgplgsh.c | 8 | ||||
-rw-r--r-- | usr.bin/bgplg/misc.c | 4 |
8 files changed, 39 insertions, 33 deletions
diff --git a/usr.bin/apply/apply.c b/usr.bin/apply/apply.c index 15a9d9f87c9..6218c6cb5d6 100644 --- a/usr.bin/apply/apply.c +++ b/usr.bin/apply/apply.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apply.c,v 1.25 2011/04/29 05:45:11 lum Exp $ */ +/* $OpenBSD: apply.c,v 1.26 2013/11/25 18:03:17 deraadt Exp $ */ /* $NetBSD: apply.c,v 1.3 1995/03/25 03:38:23 glass Exp $ */ /*- @@ -90,7 +90,8 @@ main(int argc, char *argv[]) * largest one. */ for (n = 0, p = argv[0]; *p != '\0'; ++p) - if (p[0] == magic && isdigit(p[1]) && p[1] != '0') { + if (p[0] == magic && + isdigit((unsigned char)p[1]) && p[1] != '0') { ++p; if (p[0] - '0' > n) n = p[0] - '0'; @@ -167,7 +168,8 @@ main(int argc, char *argv[]) /* Expand command argv references. */ for (p = cmd, q = c; *p != '\0'; ++p) - if (p[0] == magic && isdigit(p[1]) && p[1] != '0') { + if (p[0] == magic && + isdigit((unsigned char)p[1]) && p[1] != '0') { strlcpy(q, argv[(++p)[0] - '0'], c + clen - q); q += strlen(q); } else diff --git a/usr.bin/apropos/apropos.c b/usr.bin/apropos/apropos.c index ca07f0dc65a..95f6f2115df 100644 --- a/usr.bin/apropos/apropos.c +++ b/usr.bin/apropos/apropos.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apropos.c,v 1.15 2009/10/27 23:59:35 deraadt Exp $ */ +/* $OpenBSD: apropos.c,v 1.16 2013/11/25 18:02:49 deraadt Exp $ */ /* $NetBSD: apropos.c,v 1.5 1995/09/04 20:46:20 tls Exp $ */ /* @@ -217,7 +217,7 @@ match(char *bp, char *str) void lowstr(char *from, char *to) { - char ch; + unsigned char ch; while ((ch = *from++) && ch != '\n') *to++ = isupper(ch) ? tolower(ch) : ch; diff --git a/usr.bin/at/at.c b/usr.bin/at/at.c index 0bc7673d8a3..f1ce091a945 100644 --- a/usr.bin/at/at.c +++ b/usr.bin/at/at.c @@ -1,4 +1,4 @@ -/* $OpenBSD: at.c,v 1.61 2013/04/17 15:58:42 deraadt Exp $ */ +/* $OpenBSD: at.c,v 1.62 2013/11/25 18:02:50 deraadt Exp $ */ /* * at.c : Put file into atrun queue @@ -324,7 +324,7 @@ writefile(const char *cwd, time_t runtimer, char queue) if (*ap == '\n') (void)fprintf(fp, "\"\n\""); else { - if (!isalnum(*ap)) { + if (!isalnum((unsigned char)*ap)) { switch (*ap) { case '%': case '/': case '{': case '[': case ']': case '=': @@ -354,7 +354,7 @@ writefile(const char *cwd, time_t runtimer, char queue) if (*ap == '\n') fprintf(fp, "\"\n\""); else { - if (*ap != '/' && !isalnum(*ap)) + if (*ap != '/' && !isalnum((unsigned char)*ap)) (void)fputc('\\', fp); (void)fputc(*ap, fp); @@ -539,7 +539,8 @@ list_jobs(int argc, char **argv, int count_only, int csort) if (strtot(dirent->d_name, &ep, &runtimer) == -1) continue; - if (*ep != '.' || !isalpha(*(ep + 1)) || *(ep + 2) != '\0') + if (*ep != '.' || !isalpha((unsigned char)*(ep + 1)) || + *(ep + 2) != '\0') continue; queue = *(ep + 1); @@ -659,7 +660,7 @@ process_jobs(int argc, char **argv, int what) for (i = 0; i < argc; i++) { l = strtol(argv[i], &ep, 10); - if (*ep == '.' && isalpha(*(ep + 1)) && + if (*ep == '.' && isalpha((unsigned char)*(ep + 1)) && *(ep + 2) == '\0' && l > 0 && l < INT_MAX) jobs[jobs_len++] = argv[i]; else if ((pw = getpwnam(argv[i])) != NULL) { @@ -690,7 +691,8 @@ process_jobs(int argc, char **argv, int what) if (strtot(dirent->d_name, &ep, &runtimer) == -1) continue; - if (*ep != '.' || !isalpha(*(ep + 1)) || *(ep + 2) != '\0') + if (*ep != '.' || !isalpha((unsigned char)*(ep + 1)) || + *(ep + 2) != '\0') continue; /* Check runtimer against argv; argc==0 means do all. */ @@ -989,7 +991,8 @@ main(int argc, char **argv) usage(); atqueue = queue = *optarg; - if (!(islower(queue) || isupper(queue))) + if (!(islower((unsigned char)queue) || + isupper((unsigned char)queue))) usage(); queue_set = 1; @@ -1082,7 +1085,7 @@ main(int argc, char **argv) case BATCH: if (queue_set) - queue = toupper(queue); + queue = toupper((unsigned char)queue); else queue = DEFAULT_BATCH_QUEUE; diff --git a/usr.bin/at/parsetime.c b/usr.bin/at/parsetime.c index 97ae70f74e1..e489e53d487 100644 --- a/usr.bin/at/parsetime.c +++ b/usr.bin/at/parsetime.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parsetime.c,v 1.18 2010/07/02 23:40:09 krw Exp $ */ +/* $OpenBSD: parsetime.c,v 1.19 2013/11/25 18:02:50 deraadt Exp $ */ /* * parsetime.c - parse time for at(1) @@ -213,7 +213,7 @@ token(void) * we'll continue, which puts us up at the top of the while loop * to fetch the next argument in */ - while (isspace(*sct)) + while (isspace((unsigned char)*sct)) ++sct; if (!*sct) { need = 1; @@ -228,13 +228,13 @@ token(void) /* * then see what it is */ - if (isdigit(sc_token[0])) { - while (isdigit(*sct)) + if (isdigit((unsigned char)sc_token[0])) { + while (isdigit((unsigned char)*sct)) sc_token[++idx] = *sct++; sc_token[++idx] = 0; return ((sc_tokid = NUMBER)); - } else if (isalpha(sc_token[0])) { - while (isalpha(*sct)) + } else if (isalpha((unsigned char)sc_token[0])) { + while (isalpha((unsigned char)*sct)) sc_token[++idx] = *sct++; sc_token[++idx] = 0; return (parse_token(sc_token)); diff --git a/usr.bin/bdes/bdes.c b/usr.bin/bdes/bdes.c index e5c503d7524..65385e361f4 100644 --- a/usr.bin/bdes/bdes.c +++ b/usr.bin/bdes/bdes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bdes.c,v 1.17 2011/01/20 22:12:42 jasper Exp $ */ +/* $OpenBSD: bdes.c,v 1.18 2013/11/25 18:02:50 deraadt Exp $ */ /* $NetBSD: bdes.c,v 1.2 1995/03/26 03:33:19 glass Exp $ */ /*- @@ -430,13 +430,13 @@ setbits(char *s, int mult) /* * skip white space */ - while (isspace(*s)) + while (isspace((unsigned char)*s)) s++; /* * get the integer */ for (p = s; *p; p++) { - if (isdigit(*p)) + if (isdigit((unsigned char)*p)) n = n * 10 + *p - '0'; else { err(1, "bad decimal digit in MAC length"); diff --git a/usr.bin/bgplg/bgplg.c b/usr.bin/bgplg/bgplg.c index dc4007abb61..5b92bdd6b17 100644 --- a/usr.bin/bgplg/bgplg.c +++ b/usr.bin/bgplg/bgplg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgplg.c,v 1.11 2013/06/02 14:11:38 florian Exp $ */ +/* $OpenBSD: bgplg.c,v 1.12 2013/11/25 18:02:50 deraadt Exp $ */ /* * Copyright (c) 2005, 2006 Reyk Floeter <reyk@openbsd.org> @@ -64,8 +64,8 @@ lg_urldecode(char *str) i = c = 0; while (i < len) { if (str[i] == '%' && i <= (len - 2)) { - if (isxdigit(str[i + 1]) && - isxdigit(str[i + 2])) { + if (isxdigit((unsigned char)str[i + 1]) && + isxdigit((unsigned char)str[i + 2])) { code[0] = str[i + 1]; code[1] = str[i + 2]; code[2] = 0; @@ -111,7 +111,7 @@ lg_getenv(const char *name, int *lenp) *lenp = len; #define allowed_in_string(_x) \ - (isalnum(_x) || strchr("-_.:/= ", _x)) + (isalnum((unsigned char)_x) || strchr("-_.:/= ", _x)) for (i = 0; i < len; i++) { if (ptr[i] == '&') @@ -123,6 +123,7 @@ lg_getenv(const char *name, int *lenp) } return (ptr); +#undef allowed_in_string } char * @@ -159,7 +160,7 @@ lg_arg2argv(char *arg, int *argc) /* Count elements */ for (i = 0; i < (len - 1); i++) { - if (isspace(arg[i])) { + if (isspace((unsigned char)arg[i])) { /* filter out additional options */ if (arg[i + 1] == '-') { printf("invalid input\n"); diff --git a/usr.bin/bgplg/bgplgsh.c b/usr.bin/bgplg/bgplgsh.c index 5d4e1adda69..85f27fbe552 100644 --- a/usr.bin/bgplg/bgplgsh.c +++ b/usr.bin/bgplg/bgplgsh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgplgsh.c,v 1.5 2013/06/02 14:11:38 florian Exp $ */ +/* $OpenBSD: bgplgsh.c,v 1.6 2013/11/25 18:02:50 deraadt Exp $ */ /* * Copyright (c) 2005, 2006 Reyk Floeter <reyk@openbsd.org> @@ -61,7 +61,7 @@ lg_checkarg(char *arg) return (0); #define allowed_in_string(_x) \ - ((isalnum(_x) || isprint(_x)) && \ + ((isalnum((unsigned char)_x) || isprint((unsigned char)_x)) && \ (_x != '%' && _x != '\\' && _x != ';' && _x != '&' && _x != '|')) for (i = 0; i < len; i++) { @@ -70,7 +70,7 @@ lg_checkarg(char *arg) return (EPERM); } } - +#undef allowed_in_string return (0); } @@ -88,7 +88,7 @@ lg_arg2argv(char *arg, int *argc) /* Count elements */ for (i = 0; i < len; i++) { - if (isspace(arg[i])) { + if (isspace((unsigned char)arg[i])) { /* filter out additional options */ if (arg[i + 1] == '-') { printf("invalid input\n"); diff --git a/usr.bin/bgplg/misc.c b/usr.bin/bgplg/misc.c index 1cf880fe8b9..38837cc88c8 100644 --- a/usr.bin/bgplg/misc.c +++ b/usr.bin/bgplg/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.5 2013/06/01 18:47:55 reyk Exp $ */ +/* $OpenBSD: misc.c,v 1.6 2013/11/25 18:02:50 deraadt Exp $ */ /* * Copyright (c) 2005, 2006 Reyk Floeter <reyk@openbsd.org> @@ -165,7 +165,7 @@ lg_strip(char *str) if ((len = strlen(str)) < 1) return (0); /* XXX EINVAL? */ - if (isspace(str[len - 1])) { + if (isspace((unsigned char)str[len - 1])) { str[len - 1] = '\0'; return (lg_strip(str)); } |