-/* $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>
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);
p = buf;
/* skip leading white */
- while (isspace(*p))
+ while (isspace((unsigned char)*p))
p++;
/* allow blank lines and comment lines */
if (*p == '\0' || *p == '#')
/* 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;
}
/* skip whitespace */
- while (isspace(*p))
+ while (isspace((unsigned char)*p))
p++;
if (*p++ != '=') {
}
/* skip whitespace */
- while (isspace(*p))
+ while (isspace((unsigned char)*p))
p++;
/* parse the value */
return;
/* skip trailing whitespace */
- while (isspace(*p))
+ while (isspace((unsigned char)*p))
p++;
if (*p && *p != '#') {