summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2013-11-24 01:06:20 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2013-11-24 01:06:20 +0000
commit9fa5a397426b739e9289fb6fde63a7b1d505db1c (patch)
treecda1e16693ec05345ea20c73c742be5c2748ebe1
parenta558abec9359523a726dbcdbdf990d25b9e1fa65 (diff)
more unsigned char casts for ctype
ok jca
-rw-r--r--usr.sbin/sa/main.c4
-rw-r--r--usr.sbin/spamdb/spamdb.c6
-rw-r--r--usr.sbin/syslogd/syslogd.c30
-rw-r--r--usr.sbin/wsmoused/wsmoused.c10
-rw-r--r--usr.sbin/ypbind/ypbind.c4
5 files changed, 28 insertions, 26 deletions
diff --git a/usr.sbin/sa/main.c b/usr.sbin/sa/main.c
index 741f84a9ef3..f7c0f1c4f15 100644
--- a/usr.sbin/sa/main.c
+++ b/usr.sbin/sa/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.11 2009/10/27 23:59:54 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.12 2013/11/24 01:06:19 deraadt Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
* All rights reserved.
@@ -316,7 +316,7 @@ acct_load(char *pn, int wr)
ci.ci_calls = 1;
for (i = 0; i < sizeof(ac.ac_comm) && ac.ac_comm[i] != '\0';
i++) {
- char c = ac.ac_comm[i];
+ unsigned char c = ac.ac_comm[i];
if (!isascii(c) || iscntrl(c)) {
ci.ci_comm[i] = '?';
diff --git a/usr.sbin/spamdb/spamdb.c b/usr.sbin/spamdb/spamdb.c
index b06ca256929..cd2f489dff1 100644
--- a/usr.sbin/spamdb/spamdb.c
+++ b/usr.sbin/spamdb/spamdb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spamdb.c,v 1.28 2013/11/15 22:20:04 millert Exp $ */
+/* $OpenBSD: spamdb.c,v 1.29 2013/11/24 01:06:19 deraadt Exp $ */
/*
* Copyright (c) 2004 Bob Beck. All rights reserved.
@@ -112,8 +112,8 @@ dbupdate(DB *db, char *ip, int add, int type)
errx(-1, "not an email address: %s", ip);
/* ensure address is lower case*/
for (i = 0; ip[i] != '\0'; i++)
- if (isupper(ip[i]))
- ip[i] = (char)tolower(ip[i]);
+ if (isupper((unsigned char)ip[i]))
+ ip[i] = tolower((unsigned char)ip[i]);
break;
default:
errx(-1, "unknown type %d", type);
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index 8b771ca6066..b409465d48f 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: syslogd.c,v 1.108 2013/10/09 16:33:05 millert Exp $ */
+/* $OpenBSD: syslogd.c,v 1.109 2013/11/24 01:06:18 deraadt Exp $ */
/*
* Copyright (c) 1983, 1988, 1993, 1994
@@ -635,7 +635,7 @@ printline(char *hname, char *msg)
p = msg;
if (*p == '<') {
pri = 0;
- while (isdigit(*++p))
+ while (isdigit((unsigned char)*++p))
pri = 10 * pri + (*p - '0');
if (*p == '>')
++p;
@@ -678,7 +678,7 @@ printsys(char *msg)
pri = DEFSPRI;
if (*p == '<') {
pri = 0;
- while (isdigit(*++p))
+ while (isdigit((unsigned char)*++p))
pri = 10 * pri + (*p - '0');
if (*p == '>')
++p;
@@ -745,10 +745,10 @@ logmsg(int pri, char *msg, char *from, int flags)
prilev = LOG_PRI(pri);
/* extract program name */
- while (isspace(*msg))
+ while (isspace((unsigned char)*msg))
msg++;
for (i = 0; i < NAME_MAX; i++) {
- if (!isalnum(msg[i]) && msg[i] != '-')
+ if (!isalnum((unsigned char)msg[i]) && msg[i] != '-')
break;
prog[i] = msg[i];
}
@@ -1256,20 +1256,22 @@ init(void)
* spaces and newline character. !prog is treated
* specially: the following lines apply only to that program.
*/
- for (p = cline; isspace(*p); ++p)
+ for (p = cline; isspace((unsigned char)*p); ++p)
continue;
if (*p == '\0' || *p == '#')
continue;
if (*p == '!') {
p++;
- while (isspace(*p))
+ while (isspace((unsigned char)*p))
p++;
- if (!*p || (*p == '*' && (!p[1] || isspace(p[1])))) {
+ if (!*p || (*p == '*' && (!p[1] ||
+ isspace((unsigned char)p[1])))) {
strlcpy(prog, "*", sizeof(prog));
continue;
}
for (i = 0; i < NAME_MAX; i++) {
- if (!isalnum(p[i]) && p[i] != '-' && p[i] != '!')
+ if (!isalnum((unsigned char)p[i]) &&
+ p[i] != '-' && p[i] != '!')
break;
prog[i] = p[i];
}
@@ -1278,7 +1280,7 @@ init(void)
}
p = cline + strlen(cline);
while (p > cline)
- if (!isspace(*--p)) {
+ if (!isspace((unsigned char)*--p)) {
p++;
break;
}
@@ -1596,7 +1598,7 @@ cfline(char *line, char *prog)
/* Copy buffer name */
for(i = 0; i < sizeof(f->f_un.f_mb.f_mname) - 1; i++) {
- if (!isalnum(q[i]))
+ if (!isalnum((unsigned char)q[i]))
break;
f->f_un.f_mb.f_mname[i] = q[i];
}
@@ -1666,12 +1668,12 @@ decode(const char *name, const CODE *codetab)
const CODE *c;
char *p, buf[40];
- if (isdigit(*name))
+ if (isdigit((unsigned char)*name))
return (atoi(name));
for (p = buf; *name && p < &buf[sizeof(buf) - 1]; p++, name++) {
- if (isupper(*name))
- *p = tolower(*name);
+ if (isupper((unsigned char)*name))
+ *p = tolower((unsigned char)*name);
else
*p = *name;
}
diff --git a/usr.sbin/wsmoused/wsmoused.c b/usr.sbin/wsmoused/wsmoused.c
index 92d8e66c010..2009ccd98b0 100644
--- a/usr.sbin/wsmoused/wsmoused.c
+++ b/usr.sbin/wsmoused/wsmoused.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsmoused.c,v 1.28 2013/04/18 02:29:59 deraadt Exp $ */
+/* $OpenBSD: wsmoused.c,v 1.29 2013/11/24 01:06:19 deraadt Exp $ */
/*
* Copyright (c) 2001 Jean-Baptiste Marchand, Julien Montagne and Jerome Verdon
@@ -182,7 +182,7 @@ static int p2l[MOUSE_MAXBUTTON] = {
static char *
skipspace(char *s)
{
- while (isspace(*s))
+ while (isspace((unsigned char)*s))
++s;
return s;
}
@@ -198,7 +198,7 @@ mouse_installmap(char *arg)
while (*arg) {
arg = skipspace(arg);
s = arg;
- while (isdigit(*arg))
+ while (isdigit((unsigned char)*arg))
++arg;
arg = skipspace(arg);
if ((arg <= s) || (*arg != '='))
@@ -207,9 +207,9 @@ mouse_installmap(char *arg)
arg = skipspace(++arg);
s = arg;
- while (isdigit(*arg))
+ while (isdigit((unsigned char)*arg))
++arg;
- if (arg <= s || (!isspace(*arg) && *arg != '\0'))
+ if (arg <= s || (!isspace((unsigned char)*arg) && *arg != '\0'))
return FALSE;
pbutton = atoi(s);
diff --git a/usr.sbin/ypbind/ypbind.c b/usr.sbin/ypbind/ypbind.c
index 4fdd29a4c38..122530fa124 100644
--- a/usr.sbin/ypbind/ypbind.c
+++ b/usr.sbin/ypbind/ypbind.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ypbind.c,v 1.59 2009/10/27 23:59:57 deraadt Exp $ */
+/* $OpenBSD: ypbind.c,v 1.60 2013/11/24 01:06:19 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993, 1996, 1997, 1998 Theo de Raadt <deraadt@openbsd.org>
@@ -839,7 +839,7 @@ direct(struct _dom_binding *ypdb, char *buf, int outlen)
}
*p = '\0';
p = line;
- while (isspace(*p))
+ while (isspace((unsigned char)*p))
p++;
if (*p == '#')
continue;