diff options
| author | 2013-11-28 18:26:46 +0000 | |
|---|---|---|
| committer | 2013-11-28 18:26:46 +0000 | |
| commit | c75478fed64a7eac1aa9792a058341c32b8100bb (patch) | |
| tree | 02e2469b407f1491888a03fabf8eabcae8cea62e | |
| parent | unsigned char for ctype (diff) | |
| download | wireguard-openbsd-c75478fed64a7eac1aa9792a058341c32b8100bb.tar.xz wireguard-openbsd-c75478fed64a7eac1aa9792a058341c32b8100bb.zip | |
unsigned char for ctype
ok okan krw
| -rw-r--r-- | usr.sbin/eeprom/eehandlers.c | 8 | ||||
| -rw-r--r-- | usr.sbin/rbootd/bpf.c | 4 | ||||
| -rw-r--r-- | usr.sbin/rbootd/parseconf.c | 18 |
3 files changed, 17 insertions, 13 deletions
diff --git a/usr.sbin/eeprom/eehandlers.c b/usr.sbin/eeprom/eehandlers.c index 8eacc6c5ae1..5940846df24 100644 --- a/usr.sbin/eeprom/eehandlers.c +++ b/usr.sbin/eeprom/eehandlers.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eehandlers.c,v 1.15 2008/06/26 05:42:21 ray Exp $ */ +/* $OpenBSD: eehandlers.c,v 1.16 2013/11/28 18:26:47 deraadt Exp $ */ /* $NetBSD: eehandlers.c,v 1.2 1996/02/28 01:13:22 thorpej Exp $ */ /*- @@ -123,7 +123,7 @@ ee_num8(struct keytabent *ktent, char *arg) if (arg) { for (i = 0; i < (strlen(arg) - 1); ++i) - if (!isdigit(arg[i])) + if (!isdigit((unsigned char)arg[i])) BARF(ktent); num32 = atoi(arg); if (num32 > 0xff) @@ -147,7 +147,7 @@ ee_num16(struct keytabent *ktent, char *arg) if (arg) { for (i = 0; i < (strlen(arg) - 1); ++i) - if (!isdigit(arg[i])) + if (!isdigit((unsigned char)arg[i])) BARF(ktent); num32 = atoi(arg); if (num32 > 0xffff) @@ -321,7 +321,7 @@ ee_kbdtype(struct keytabent *ktent, char *arg) if (arg) { for (i = 0; i < (strlen(arg) - 1); ++i) - if (!isdigit(arg[i])) + if (!isdigit((unsigned char)arg[i])) BARF(ktent); kbd2 = atoi(arg); if (kbd2 > 0xff) diff --git a/usr.sbin/rbootd/bpf.c b/usr.sbin/rbootd/bpf.c index 2e2a1db05f4..db81ed2a469 100644 --- a/usr.sbin/rbootd/bpf.c +++ b/usr.sbin/rbootd/bpf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bpf.c,v 1.18 2013/04/20 20:12:10 miod Exp $ */ +/* $OpenBSD: bpf.c,v 1.19 2013/11/28 18:26:46 deraadt Exp $ */ /* $NetBSD: bpf.c,v 1.5.2.1 1995/11/14 08:45:42 thorpej Exp $ */ /* @@ -287,7 +287,7 @@ BpfGetIntfName(char **errmsg) #endif continue; - for (cp = ifa->ifa_name; !isdigit(*cp); ++cp) + for (cp = ifa->ifa_name; !isdigit((unsigned char)*cp); ++cp) ; n = atoi(cp); if (n < minunit) { diff --git a/usr.sbin/rbootd/parseconf.c b/usr.sbin/rbootd/parseconf.c index cb9c282f4e6..f2d36b75afc 100644 --- a/usr.sbin/rbootd/parseconf.c +++ b/usr.sbin/rbootd/parseconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parseconf.c,v 1.10 2009/10/27 23:59:54 deraadt Exp $ */ +/* $OpenBSD: parseconf.c,v 1.11 2013/11/28 18:26:46 deraadt Exp $ */ /* $NetBSD: parseconf.c,v 1.4 1995/10/06 05:12:16 thorpej Exp $ */ /* @@ -109,10 +109,13 @@ ParseConfig(void) * and null terminates it. `cp' is positioned at the start * of the next token. spaces & commas are separators. */ -#define GETSTR while (isspace(*cp) || *cp == ',') cp++; \ - bcp = cp; \ - while (*cp && *cp!=',' && !isspace(*cp)) cp++; \ - if (*cp) *cp++ = '\0' +#define GETSTR while (isspace((unsigned char)*cp) || *cp == ',') \ + cp++; \ + bcp = cp; \ + while (*cp && *cp!=',' && !isspace((unsigned char)*cp)) \ + cp++; \ + if (*cp) \ + *cp++ = '\0' /* * For each line, parse it into a new CLIENT struct. @@ -262,10 +265,11 @@ ParseAddr(char *str) /* * Convert hex character to an integer. */ - if (isdigit(*cp)) + if (isdigit((unsigned char)*cp)) i = *cp - '0'; else { - i = (isupper(*cp)? tolower(*cp): *cp) - 'a' + 10; + i = (isupper((unsigned char)*cp) ? + tolower((unsigned char)*cp) : *cp) - 'a' + 10; if (i < 10 || i > 15) /* not a hex char */ return(NULL); } |
