diff options
-rw-r--r-- | lib/libcompat/regexp/regexp.c | 9 | ||||
-rw-r--r-- | lib/libkeynote/environment.c | 4 | ||||
-rw-r--r-- | lib/libkeynote/keynote-ver.l | 4 | ||||
-rw-r--r-- | lib/libkeynote/keynote.l | 4 | ||||
-rw-r--r-- | lib/libkeynote/keynote.y | 4 | ||||
-rw-r--r-- | lib/libkeynote/parse_assertion.c | 8 | ||||
-rw-r--r-- | lib/libskey/put.c | 8 | ||||
-rw-r--r-- | lib/libskey/skeylogin.c | 13 | ||||
-rw-r--r-- | lib/libskey/skeysubr.c | 6 | ||||
-rw-r--r-- | lib/libusbhid/usage.c | 8 | ||||
-rw-r--r-- | lib/libutil/fmt_scaled.c | 11 |
11 files changed, 41 insertions, 38 deletions
diff --git a/lib/libcompat/regexp/regexp.c b/lib/libcompat/regexp/regexp.c index 23f5b29ef45..a217ea7d491 100644 --- a/lib/libcompat/regexp/regexp.c +++ b/lib/libcompat/regexp/regexp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: regexp.c,v 1.6 2009/10/27 23:59:28 deraadt Exp $ */ +/* $OpenBSD: regexp.c,v 1.7 2013/11/29 19:00:50 deraadt Exp $ */ /* * regcomp and regexec -- regsub and regerror are elsewhere @@ -911,16 +911,17 @@ char *prog; break; case WORDA: /* Must be looking at a letter, digit, or _ */ - if ((!isalnum(*reginput)) && *reginput != '_') + if ((!isalnum((unsigned char)*reginput)) && *reginput != '_') return(0); /* Prev must be BOL or nonword */ if (reginput > regbol && - (isalnum(reginput[-1]) || reginput[-1] == '_')) + (isalnum((unsigned char)reginput[-1]) || + reginput[-1] == '_')) return(0); break; case WORDZ: /* Must be looking at non letter, digit, or _ */ - if (isalnum(*reginput) || *reginput == '_') + if (isalnum((unsigned char)*reginput) || *reginput == '_') return(0); /* We don't care what the previous char was */ break; diff --git a/lib/libkeynote/environment.c b/lib/libkeynote/environment.c index cf041afeb75..f982225ee4a 100644 --- a/lib/libkeynote/environment.c +++ b/lib/libkeynote/environment.c @@ -1,4 +1,4 @@ -/* $OpenBSD: environment.c,v 1.20 2005/01/05 09:58:38 hshoexer Exp $ */ +/* $OpenBSD: environment.c,v 1.21 2013/11/29 19:00:51 deraadt Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -905,7 +905,7 @@ kn_read_asserts(char *buffer, int bufferlen, int *numassertions) else flag = 0; - if (!isspace((int) buffer[i])) + if (!isspace((unsigned char)buffer[i])) valid = 1; } diff --git a/lib/libkeynote/keynote-ver.l b/lib/libkeynote/keynote-ver.l index 4813f0ecbaf..08cdf2c176f 100644 --- a/lib/libkeynote/keynote-ver.l +++ b/lib/libkeynote/keynote-ver.l @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: keynote-ver.l,v 1.15 2011/04/06 11:36:23 miod Exp $ */ +/* $OpenBSD: keynote-ver.l,v 1.16 2013/11/29 19:00:51 deraadt Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -161,7 +161,7 @@ mystrncpy(char *s1, char *s2, int len) if (*s2 == '\n') { - while (isspace((int) *(++s2)) && (len-- > 0)) + while (isspace((unsigned char)*(++s2)) && (len-- > 0)) ; } else diff --git a/lib/libkeynote/keynote.l b/lib/libkeynote/keynote.l index d42aa2db270..b3f0ffd4f16 100644 --- a/lib/libkeynote/keynote.l +++ b/lib/libkeynote/keynote.l @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: keynote.l,v 1.19 2011/04/06 11:36:23 miod Exp $ */ +/* $OpenBSD: keynote.l,v 1.20 2013/11/29 19:00:51 deraadt Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -402,7 +402,7 @@ mystrncpy(char *s1, char *s2, int len) if (*s2 == '\n') { - while (isspace((int) *(++s2)) && (len-- > 0)) + while (isspace((unsigned char)*(++s2)) && (len-- > 0)) ; } else diff --git a/lib/libkeynote/keynote.y b/lib/libkeynote/keynote.y index c3d29bb15c5..d46c9efcef5 100644 --- a/lib/libkeynote/keynote.y +++ b/lib/libkeynote/keynote.y @@ -1,4 +1,4 @@ -/* $OpenBSD: keynote.y,v 1.15 2004/06/29 11:35:56 msf Exp $ */ +/* $OpenBSD: keynote.y,v 1.16 2013/11/29 19:00:51 deraadt Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -827,7 +827,7 @@ isfloatstring(char *s) int i, point = 0; for (i = strlen(s) - 1; i >= 0; i--) - if (!isdigit((int) s[i])) + if (!isdigit((unsigned char)s[i])) { if (s[i] == '.') { diff --git a/lib/libkeynote/parse_assertion.c b/lib/libkeynote/parse_assertion.c index ad271146e05..299a9bafb21 100644 --- a/lib/libkeynote/parse_assertion.c +++ b/lib/libkeynote/parse_assertion.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse_assertion.c,v 1.13 2004/06/29 11:35:56 msf Exp $ */ +/* $OpenBSD: parse_assertion.c,v 1.14 2013/11/29 19:00:51 deraadt Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -392,7 +392,7 @@ keynote_parse_assertion(char *buf, int len, int assertion_flags) ASSERT_FLAG_SIGVER); /* Skip any leading whitespace */ - for (i = 0, j = len; i < j && isspace((int) as->as_buf[i]); i++) + for (i = 0, j = len; i < j && isspace((unsigned char)as->as_buf[i]); i++) ; /* Keyword must start at begining of buffer or line */ @@ -467,7 +467,7 @@ keynote_parse_assertion(char *buf, int len, int assertion_flags) /* If newline followed by non-whitespace or comment character */ if ((as->as_buf[i] == '\n') && - (!isspace((int) as->as_buf[i + 1])) && + (!isspace((unsigned char)as->as_buf[i + 1])) && (as->as_buf[i + 1] != '#')) { te = as->as_buf + i; @@ -598,7 +598,7 @@ keynote_parse_assertion(char *buf, int len, int assertion_flags) /* Check whether there's something else following */ for (k = 1; te + k < as->as_buf + len && *(te + k) != '\n'; k++) - if (!isspace((int) *(te + k))) + if (!isspace((unsigned char)*(te + k))) { keynote_free_assertion(as); keynote_errno = ERROR_SYNTAX; diff --git a/lib/libskey/put.c b/lib/libskey/put.c index 1177a364a65..85d00f6892c 100644 --- a/lib/libskey/put.c +++ b/lib/libskey/put.c @@ -8,7 +8,7 @@ * * Dictionary lookup and extraction. * - * $OpenBSD: put.c,v 1.13 2003/04/03 17:48:50 millert Exp $ + * $OpenBSD: put.c,v 1.14 2013/11/29 19:00:51 deraadt Exp $ */ #include <stdio.h> @@ -492,10 +492,10 @@ static void standard(char *word) { while (*word) { - if (!isascii(*word)) + if (!isascii((unsigned char)*word)) break; - if (islower(*word)) - *word = toupper(*word); + if (islower((unsigned char)*word)) + *word = toupper((unsigned char)*word); if (*word == '1') *word = 'L'; if (*word == '0') diff --git a/lib/libskey/skeylogin.c b/lib/libskey/skeylogin.c index 74f26346cc8..bd4a97cc3ca 100644 --- a/lib/libskey/skeylogin.c +++ b/lib/libskey/skeylogin.c @@ -10,7 +10,7 @@ * * S/Key verification check, lookups, and authentication. * - * $OpenBSD: skeylogin.c,v 1.54 2007/03/20 03:40:06 tedu Exp $ + * $OpenBSD: skeylogin.c,v 1.55 2013/11/29 19:00:51 deraadt Exp $ */ #include <sys/param.h> @@ -141,7 +141,7 @@ skeygetent(int fd, struct skey *mp, const char *name) mp->keyfile = keyfile; if ((nread = fread(mp->buf, 1, sizeof(mp->buf), keyfile)) == 0 || - !isspace(mp->buf[nread - 1])) + !isspace((unsigned char)mp->buf[nread - 1])) goto bad_keyfile; mp->buf[nread - 1] = '\0'; @@ -275,7 +275,7 @@ skeyverify(struct skey *mp, char *response) */ (void)fseek(mp->keyfile, 0L, SEEK_SET); if ((nread = fread(mp->buf, 1, sizeof(mp->buf), mp->keyfile)) == 0 || - !isspace(mp->buf[nread - 1])) + !isspace((unsigned char)mp->buf[nread - 1])) goto verify_failure; if ((mp->logname = strtok_r(mp->buf, " \t\r\n", &last)) == NULL) goto verify_failure; @@ -430,9 +430,10 @@ skey_fakeprompt(char *username, char *skeyprompt) if (gethostname(pbuf, sizeof(pbuf)) == -1) *(p = pbuf) = '.'; else - for (p = pbuf; isalnum(*p); p++) - if (isalpha(*p) && isupper(*p)) - *p = (char)tolower(*p); + for (p = pbuf; isalnum((unsigned char)*p); p++) + if (isalpha((unsigned char)*p) && + isupper((unsigned char)*p)) + *p = (char)tolower((unsigned char)*p); if (*p && pbuf - p < 4) (void)strncpy(p, "asjd", 4 - (pbuf - p)); pbuf[4] = '\0'; diff --git a/lib/libskey/skeysubr.c b/lib/libskey/skeysubr.c index 079b2a0a136..4f2cb7e4a36 100644 --- a/lib/libskey/skeysubr.c +++ b/lib/libskey/skeysubr.c @@ -9,7 +9,7 @@ * * S/Key misc routines. * - * $OpenBSD: skeysubr.c,v 1.30 2007/05/17 04:34:50 ray Exp $ + * $OpenBSD: skeysubr.c,v 1.31 2013/11/29 19:00:51 deraadt Exp $ */ #include <stdio.h> @@ -481,7 +481,7 @@ lowcase(char *s) char *p; for (p = s; *p; p++) { - if (isupper(*p)) - *p = (char)tolower(*p); + if (isupper((unsigned char)*p)) + *p = (char)tolower((unsigned char)*p); } } diff --git a/lib/libusbhid/usage.c b/lib/libusbhid/usage.c index 12f157d6eab..22b4367ec0b 100644 --- a/lib/libusbhid/usage.c +++ b/lib/libusbhid/usage.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usage.c,v 1.14 2011/04/06 11:36:25 miod Exp $ */ +/* $OpenBSD: usage.c,v 1.15 2013/11/29 19:00:51 deraadt Exp $ */ /* $NetBSD: usage.c,v 1.1 2001/12/28 17:45:27 augustss Exp $ */ /* @@ -93,7 +93,7 @@ hid_start(const char *hidname) break; if (line[0] == '#') continue; - for (p = line; isspace(*p); p++) + for (p = line; isspace((unsigned char)*p); p++) ; if (!*p) continue; @@ -107,13 +107,13 @@ hid_start(const char *hidname) goto fail; } for (p = name; *p; p++) - if (isspace(*p) || *p == '.') + if (isspace((unsigned char)*p) || *p == '.') *p = '_'; n = strdup(name); if (!n) goto fail; - if (isspace(line[0])) { + if (isspace((unsigned char)line[0])) { if (!curpage) { warnx("file %s, line %d, syntax error", hidname, lineno); diff --git a/lib/libutil/fmt_scaled.c b/lib/libutil/fmt_scaled.c index 83f9fa91fc0..eecbde7a68f 100644 --- a/lib/libutil/fmt_scaled.c +++ b/lib/libutil/fmt_scaled.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fmt_scaled.c,v 1.11 2012/11/12 14:07:20 halex Exp $ */ +/* $OpenBSD: fmt_scaled.c,v 1.12 2013/11/29 19:00:51 deraadt Exp $ */ /* * Copyright (c) 2001, 2002, 2003 Ian F. Darwin. All rights reserved. @@ -77,7 +77,7 @@ scan_scaled(char *scaled, long long *result) long long scale_fact = 1, whole = 0, fpart = 0; /* Skip leading whitespace */ - while (isascii(*p) && isspace(*p)) + while (isascii((unsigned char)*p) && isspace((unsigned char)*p)) ++p; /* Then at most one leading + or - */ @@ -104,7 +104,8 @@ scan_scaled(char *scaled, long long *result) * (but note that E for Exa might look like e to some!). * Advance 'p' to end, to get scale factor. */ - for (; isascii(*p) && (isdigit(*p) || *p=='.'); ++p) { + for (; isascii((unsigned char)*p) && + (isdigit((unsigned char)*p) || *p=='.'); ++p) { if (*p == '.') { if (fract_digits > 0) { /* oops, more than one '.' */ errno = EINVAL; @@ -148,10 +149,10 @@ scan_scaled(char *scaled, long long *result) /* Are we there yet? */ if (*p == scale_chars[i] || - *p == tolower(scale_chars[i])) { + *p == tolower((unsigned char)scale_chars[i])) { /* If it ends with alphanumerics after the scale char, bad. */ - if (isalnum(*(p+1))) { + if (isalnum((unsigned char)*(p+1))) { errno = EINVAL; return -1; } |