summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2013-11-23 17:38:16 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2013-11-23 17:38:16 +0000
commit0a53ec2461502f772a9dd430223ba7a507094c59 (patch)
treefd97128a5cd38cc401ea77935a38e7cade49f72c
parentcd9f8458f2105861de013104373fdf11870cced9 (diff)
unsigned char casts for ctype
ok jca
-rw-r--r--usr.sbin/config/cmd.c6
-rw-r--r--usr.sbin/config/main.c11
-rw-r--r--usr.sbin/config/mkheaders.c5
-rw-r--r--usr.sbin/config/mkmakefile.c4
-rw-r--r--usr.sbin/config/sem.c12
5 files changed, 21 insertions, 17 deletions
diff --git a/usr.sbin/config/cmd.c b/usr.sbin/config/cmd.c
index 13078c9633e..4d2266efdab 100644
--- a/usr.sbin/config/cmd.c
+++ b/usr.sbin/config/cmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd.c,v 1.19 2011/10/02 22:20:49 edd Exp $ */
+/* $OpenBSD: cmd.c,v 1.20 2013/11/23 17:38:15 deraadt Exp $ */
/*
* Copyright (c) 1999-2001 Mats O Jansson. All rights reserved.
@@ -264,9 +264,9 @@ Xtimezone(cmd_t *cmd)
if (number(cmd->args, &num) == 0) {
tz->tz_minuteswest = num;
c = cmd->args;
- while ((*c != '\0') && !isspace(*c))
+ while ((*c != '\0') && !isspace((unsigned char)*c))
c++;
- while (isspace(*c))
+ while (isspace((unsigned char)*c))
c++;
if (strlen(c) != 0 && number(c, &num) == 0)
tz->tz_dsttime = num;
diff --git a/usr.sbin/config/main.c b/usr.sbin/config/main.c
index e1926c7b984..d07cb8abcc7 100644
--- a/usr.sbin/config/main.c
+++ b/usr.sbin/config/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.45 2013/10/29 15:37:56 espie Exp $ */
+/* $OpenBSD: main.c,v 1.46 2013/11/23 17:38:15 deraadt Exp $ */
/* $NetBSD: main.c,v 1.22 1997/02/02 21:12:33 thorpej Exp $ */
/*
@@ -360,7 +360,8 @@ defoption(const char *name)
*/
low = emalloc(strlen(name) + 1);
for (n = name, p = low; (c = *n) != '\0'; n++)
- *p++ = isupper(c) ? tolower(c) : c;
+ *p++ = isupper((unsigned char)c) ?
+ tolower((unsigned char)c) : c;
*p = 0;
n = intern(low);
@@ -406,7 +407,8 @@ removeoption(const char *name)
low = emalloc(strlen(name) + 1);
/* make lowercase, then remove from select table */
for (n = name, p = low; (c = *n) != '\0'; n++)
- *p++ = isupper(c) ? tolower(c) : c;
+ *p++ = isupper((unsigned char)c) ?
+ tolower((unsigned char)c) : c;
*p = 0;
n = intern(low);
free(low);
@@ -429,7 +431,8 @@ addoption(const char *name, const char *value)
low = emalloc(strlen(name) + 1);
/* make lowercase, then add to select table */
for (n = name, p = low; (c = *n) != '\0'; n++)
- *p++ = isupper(c) ? tolower(c) : c;
+ *p++ = isupper((unsigned char)c) ?
+ tolower((unsigned char)c) : c;
*p = 0;
n = intern(low);
free(low);
diff --git a/usr.sbin/config/mkheaders.c b/usr.sbin/config/mkheaders.c
index 0572f604bdf..6f29be63686 100644
--- a/usr.sbin/config/mkheaders.c
+++ b/usr.sbin/config/mkheaders.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mkheaders.c,v 1.19 2011/10/02 22:20:49 edd Exp $ */
+/* $OpenBSD: mkheaders.c,v 1.20 2013/11/23 17:38:15 deraadt Exp $ */
/* $NetBSD: mkheaders.c,v 1.12 1997/02/02 21:12:34 thorpej Exp $ */
/*
@@ -208,7 +208,8 @@ cntname(const char *src)
dst = buf;
*dst++ = 'N';
while ((c = *src++) != 0)
- *dst++ = islower(c) ? toupper(c) : c;
+ *dst++ = islower((unsigned char)c) ?
+ toupper((unsigned char)c) : c;
*dst = 0;
return (buf);
}
diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c
index 9af4dfbba0e..80886956084 100644
--- a/usr.sbin/config/mkmakefile.c
+++ b/usr.sbin/config/mkmakefile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mkmakefile.c,v 1.38 2013/10/29 15:37:56 espie Exp $ */
+/* $OpenBSD: mkmakefile.c,v 1.39 2013/11/23 17:38:15 deraadt Exp $ */
/* $NetBSD: mkmakefile.c,v 1.34 1997/02/02 21:12:36 thorpej Exp $ */
/*
@@ -375,7 +375,7 @@ emitfiles(FILE *fp, int suffix)
struct files *fi;
int lpos, len, sp;
const char *fpath;
- int uppersuffix = toupper(suffix);
+ char uppersuffix = toupper((unsigned char)suffix);
if (fprintf(fp, "%cFILES=", uppersuffix) < 0)
return (1);
diff --git a/usr.sbin/config/sem.c b/usr.sbin/config/sem.c
index 6dad69182a4..a78198812fc 100644
--- a/usr.sbin/config/sem.c
+++ b/usr.sbin/config/sem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sem.c,v 1.32 2011/10/02 22:20:50 edd Exp $ */
+/* $OpenBSD: sem.c,v 1.33 2013/11/23 17:38:15 deraadt Exp $ */
/* $NetBSD: sem.c,v 1.10 1996/11/11 23:40:11 gwr Exp $ */
/*
@@ -441,7 +441,7 @@ getdevattach(const char *name)
if (!isalnum(*p) && *p != '_')
goto badname;
}
- if (isdigit(*--p)) {
+ if (isdigit((unsigned char)*--p)) {
badname:
error("bad device attachment name `%s'", name);
return (&errdeva);
@@ -576,7 +576,7 @@ resolve(struct nvlist **nvp, const char *name, const char *what,
l = strlen(nv->nv_str);
cp = &nv->nv_str[l];
if (l > 1 && *--cp >= 'a' && *cp <= 'a'+maxpartitions &&
- isdigit(cp[-1])) {
+ isdigit((unsigned char)cp[-1])) {
l--;
part = *cp - 'a';
}
@@ -1005,10 +1005,10 @@ split(const char *name, size_t nlen, char *base, size_t bsize, int *aunit)
size_t l;
l = nlen;
- if (l < 2 || l >= bsize || isdigit(*name))
+ if (l < 2 || l >= bsize || isdigit((unsigned char)*name))
return (1);
c = (u_char)name[--l];
- if (!isdigit(c)) {
+ if (!isdigit((unsigned char)c)) {
if (c == '*')
*aunit = STAR;
else if (c == '?')
@@ -1017,7 +1017,7 @@ split(const char *name, size_t nlen, char *base, size_t bsize, int *aunit)
return (1);
} else {
cp = &name[l];
- while (isdigit(cp[-1]))
+ while (isdigit((unsigned char)cp[-1]))
l--, cp--;
*aunit = atoi(cp);
}