summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmcc <mmcc@openbsd.org>2015-10-24 18:10:47 +0000
committermmcc <mmcc@openbsd.org>2015-10-24 18:10:47 +0000
commit1c1551e9c19d5de9ab699e1675d3c680e7aaad0c (patch)
tree711af26d90a55a2cd7a839cbb1c4fb33297d6931
parentCast ctype functions' arguments to unsigned char. (diff)
downloadwireguard-openbsd-1c1551e9c19d5de9ab699e1675d3c680e7aaad0c.tar.xz
wireguard-openbsd-1c1551e9c19d5de9ab699e1675d3c680e7aaad0c.zip
Cast ctype functions' arguments to unsigned char.
ok guenther@
-rw-r--r--games/hunt/huntd/conf.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/games/hunt/huntd/conf.c b/games/hunt/huntd/conf.c
index f13d36bef50..cf2b5861f15 100644
--- a/games/hunt/huntd/conf.c
+++ b/games/hunt/huntd/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.7 2007/03/20 03:43:50 tedu Exp $ */
+/* $OpenBSD: conf.c,v 1.8 2015/10/24 18:10:47 mmcc Exp $ */
/* David Leonard <d@openbsd.org>, 1999. Public domain. */
#include <stdio.h>
@@ -137,9 +137,10 @@ parse_int(p, kvp, fnm, linep)
if (*p == '-')
p++;
digitstart = p;
- while (isdigit(*p))
+ while (isdigit((unsigned char)*p))
p++;
- if ((*p == '\0' || isspace(*p) || *p == '#') && digitstart != p) {
+ if ((*p == '\0' || isspace((unsigned char)*p) || *p == '#') &&
+ digitstart != p) {
savec = *p;
*p = '\0';
newval = atoi(valuestart);
@@ -190,7 +191,7 @@ parse_line(buf, fnm, line)
p = buf;
/* skip leading white */
- while (isspace(*p))
+ while (isspace((unsigned char)*p))
p++;
/* allow blank lines and comment lines */
if (*p == '\0' || *p == '#')
@@ -198,9 +199,9 @@ parse_line(buf, fnm, line)
/* walk to the end of the word: */
word = p;
- if (isalpha(*p) || *p == '_') {
+ if (isalpha((unsigned char)*p) || *p == '_') {
p++;
- while (isalpha(*p) || isdigit(*p) || *p == '_')
+ while (isalpha((unsigned char)*p) || isdigit((unsigned char)*p) || *p == '_')
p++;
}
endword = p;
@@ -227,7 +228,7 @@ parse_line(buf, fnm, line)
}
/* skip whitespace */
- while (isspace(*p))
+ while (isspace((unsigned char)*p))
p++;
if (*p++ != '=') {
@@ -236,7 +237,7 @@ parse_line(buf, fnm, line)
}
/* skip whitespace */
- while (isspace(*p))
+ while (isspace((unsigned char)*p))
p++;
/* parse the value */
@@ -245,7 +246,7 @@ parse_line(buf, fnm, line)
return;
/* skip trailing whitespace */
- while (isspace(*p))
+ while (isspace((unsigned char)*p))
p++;
if (*p && *p != '#') {