diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-11-27 21:25:41 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-11-27 21:25:41 +0000 |
commit | 1811834170bb3dcb7e6f52d498aafb42d4584953 (patch) | |
tree | 1dcc702616e850256b06de54ac370c976fb742da | |
parent | 3f55a14052f7f33809c84e093c3f451ef8aec80f (diff) |
unsigned char for ctype
ok okan kettenis
-rw-r--r-- | libexec/ftpd/ftpcmd.y | 16 | ||||
-rw-r--r-- | libexec/getty/main.c | 8 | ||||
-rw-r--r-- | libexec/identd/parse.c | 6 | ||||
-rw-r--r-- | libexec/ld.so/resolve.c | 4 | ||||
-rw-r--r-- | libexec/login_radius/login_radius.c | 4 | ||||
-rw-r--r-- | libexec/login_radius/raddauth.c | 10 | ||||
-rw-r--r-- | libexec/login_token/token.c | 6 | ||||
-rw-r--r-- | libexec/login_yubikey/login_yubikey.c | 4 | ||||
-rw-r--r-- | libexec/rpc.yppasswdd/yppasswdd_mkpw.c | 4 | ||||
-rw-r--r-- | libexec/spamd/grey.c | 8 | ||||
-rw-r--r-- | libexec/talkd/process.c | 4 |
11 files changed, 37 insertions, 37 deletions
diff --git a/libexec/ftpd/ftpcmd.y b/libexec/ftpd/ftpcmd.y index 619ef4f19f4..7ca420e2517 100644 --- a/libexec/ftpd/ftpcmd.y +++ b/libexec/ftpd/ftpcmd.y @@ -1,4 +1,4 @@ -/* $OpenBSD: ftpcmd.y,v 1.54 2012/03/04 04:05:15 fgsch Exp $ */ +/* $OpenBSD: ftpcmd.y,v 1.55 2013/11/27 21:25:25 deraadt Exp $ */ /* $NetBSD: ftpcmd.y,v 1.7 1996/04/08 19:03:11 jtc Exp $ */ /* @@ -1312,9 +1312,9 @@ yylex() cpos++; return (SP); } - if (isdigit(cbuf[cpos])) { + if (isdigit((unsigned char)cbuf[cpos])) { cp = &cbuf[cpos]; - while (isdigit(cbuf[++cpos])) + while (isdigit((unsigned char)cbuf[++cpos])) ; c = cbuf[cpos]; cbuf[cpos] = '\0'; @@ -1327,9 +1327,9 @@ yylex() goto dostr1; case ARGS: - if (isdigit(cbuf[cpos])) { + if (isdigit((unsigned char)cbuf[cpos])) { cp = &cbuf[cpos]; - while (isdigit(cbuf[++cpos])) + while (isdigit((unsigned char)cbuf[++cpos])) ; c = cbuf[cpos]; cbuf[cpos] = '\0'; @@ -1338,7 +1338,7 @@ yylex() return (NUMBER); } if (strncasecmp(&cbuf[cpos], "ALL", 3) == 0 && - !isalnum(cbuf[cpos + 3])) { + !isalnum((unsigned char)cbuf[cpos + 3])) { cpos += 3; return ALL; } @@ -1420,8 +1420,8 @@ upper(s) char *p; for (p = s; *p; p++) { - if (islower(*p)) - *p = (char)toupper(*p); + if (islower((unsigned char)*p)) + *p = (char)toupper((unsigned char)*p); } } diff --git a/libexec/getty/main.c b/libexec/getty/main.c index 25ea83d4d8e..a0905ebb264 100644 --- a/libexec/getty/main.c +++ b/libexec/getty/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.31 2013/06/04 22:23:18 benno Exp $ */ +/* $OpenBSD: main.c,v 1.32 2013/11/27 21:25:25 deraadt Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -446,13 +446,13 @@ putpad(char *s) int pad = 0; speed_t ospeed = cfgetospeed(&tmode); - if (isdigit(*s)) { - while (isdigit(*s)) { + if (isdigit((unsigned char)*s)) { + while (isdigit((unsigned char)*s)) { pad *= 10; pad += *s++ - '0'; } pad *= 10; - if (*s == '.' && isdigit(s[1])) { + if (*s == '.' && isdigit((unsigned char)s[1])) { pad += s[1] - '0'; s += 2; } diff --git a/libexec/identd/parse.c b/libexec/identd/parse.c index 768b2ec9f3b..36067f57a22 100644 --- a/libexec/identd/parse.c +++ b/libexec/identd/parse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.46 2008/04/13 00:22:17 djm Exp $ */ +/* $OpenBSD: parse.c,v 1.47 2013/11/27 21:25:25 deraadt Exp $ */ /* * This program is in the public domain and may be used freely by anyone @@ -214,7 +214,7 @@ parse(int fd, struct in_addr *laddr, struct in_addr *faddr) /* Pull out local and remote ports */ p = buf; - while (isspace(*p)) + while (isspace((unsigned char)*p)) p++; if ((p = strtok(p, " \t,"))) { lport = atoi(p); @@ -412,7 +412,7 @@ parse6(int fd, struct sockaddr_in6 *laddr, struct sockaddr_in6 *faddr) /* Pull out local and remote ports */ p = buf; - while (isspace(*p)) + while (isspace((unsigned char)*p)) p++; if ((p = strtok(p, " \t,"))) { lport = atoi(p); diff --git a/libexec/ld.so/resolve.c b/libexec/ld.so/resolve.c index ab7779ff7a2..1956dc39290 100644 --- a/libexec/ld.so/resolve.c +++ b/libexec/ld.so/resolve.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resolve.c,v 1.64 2013/11/13 05:41:42 deraadt Exp $ */ +/* $OpenBSD: resolve.c,v 1.65 2013/11/27 21:25:25 deraadt Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -143,7 +143,7 @@ _dl_origin_subst_path(elf_object_t *object, const char *origin_path, /* skip over name */ name = pp; - while (_dl_isalnum(*pp) || *pp == '_') + while (_dl_isalnum((unsigned char)*pp) || *pp == '_') pp++; switch (_dl_subst_name(name, pp - name)) { diff --git a/libexec/login_radius/login_radius.c b/libexec/login_radius/login_radius.c index 9fffef843a1..793f1671cdd 100644 --- a/libexec/login_radius/login_radius.c +++ b/libexec/login_radius/login_radius.c @@ -1,4 +1,4 @@ -/* $OpenBSD: login_radius.c,v 1.6 2007/03/21 03:32:28 tedu Exp $ */ +/* $OpenBSD: login_radius.c,v 1.7 2013/11/27 21:25:25 deraadt Exp $ */ /*- * Copyright (c) 1996, 1997 Berkeley Software Design, Inc. All rights reserved. @@ -204,7 +204,7 @@ static int cleanstring(char *s) { - while (isgraph(*s) && *s != '\\') + while (isgraph((unsigned char)*s) && *s != '\\') ++s; return(*s == '\0' ? 1 : 0); } diff --git a/libexec/login_radius/raddauth.c b/libexec/login_radius/raddauth.c index 331bc567959..8dc50149086 100644 --- a/libexec/login_radius/raddauth.c +++ b/libexec/login_radius/raddauth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raddauth.c,v 1.24 2012/12/04 02:24:47 deraadt Exp $ */ +/* $OpenBSD: raddauth.c,v 1.25 2013/11/27 21:25:25 deraadt Exp $ */ /*- * Copyright (c) 1996, 1997 Berkeley Software Design, Inc. All rights reserved. @@ -540,17 +540,17 @@ getsecret(void) memset(host, 0, len); host = secret; } - while (len > 0 && isspace(host[--len])) + while (len > 0 && isspace((unsigned char)host[--len])) ; host[++len] = '\0'; - while (isspace(*host)) { + while (isspace((unsigned char)*host)) { ++host; --len; } if (*host == '\0') continue; secret = host; - while (*secret && !isspace(*secret)) + while (*secret && !isspace((unsigned char)*secret)) ++secret; if (*secret) *secret++ = '\0'; @@ -558,7 +558,7 @@ getsecret(void) memset(host, 0, len); continue; } - while (isspace(*secret)) + while (isspace((unsigned char)*secret)) ++secret; if (*secret) break; diff --git a/libexec/login_token/token.c b/libexec/login_token/token.c index 83ed46986d7..4bc65bf2e2b 100644 --- a/libexec/login_token/token.c +++ b/libexec/login_token/token.c @@ -1,4 +1,4 @@ -/* $OpenBSD: token.c,v 1.16 2013/08/22 04:43:40 guenther Exp $ */ +/* $OpenBSD: token.c,v 1.17 2013/11/27 21:25:25 deraadt Exp $ */ /*- * Copyright (c) 1995 Migration Associates Corp. All Rights Reserved @@ -383,8 +383,8 @@ static void lcase(char *cp) { while (*cp) { - if (isupper(*cp)) - *cp = tolower(*cp); + if (isupper((unsigned char)*cp)) + *cp = tolower((unsigned char)*cp); cp++; } } diff --git a/libexec/login_yubikey/login_yubikey.c b/libexec/login_yubikey/login_yubikey.c index e5eeaeb4f9a..bb9bb014258 100644 --- a/libexec/login_yubikey/login_yubikey.c +++ b/libexec/login_yubikey/login_yubikey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: login_yubikey.c,v 1.7 2013/11/02 15:34:13 benno Exp $ */ +/* $OpenBSD: login_yubikey.c,v 1.8 2013/11/27 21:25:25 deraadt Exp $ */ /* * Copyright (c) 2010 Daniel Hartmeier <daniel@benzedrine.cx> @@ -168,7 +168,7 @@ static int clean_string(const char *s) { while (*s) { - if (!isalnum(*s) && *s != '-' && *s != '_') + if (!isalnum((unsigned char)*s) && *s != '-' && *s != '_') return (0); ++s; } diff --git a/libexec/rpc.yppasswdd/yppasswdd_mkpw.c b/libexec/rpc.yppasswdd/yppasswdd_mkpw.c index 0d3220ab055..260115e65d0 100644 --- a/libexec/rpc.yppasswdd/yppasswdd_mkpw.c +++ b/libexec/rpc.yppasswdd/yppasswdd_mkpw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yppasswdd_mkpw.c,v 1.30 2012/12/04 02:24:47 deraadt Exp $ */ +/* $OpenBSD: yppasswdd_mkpw.c,v 1.31 2013/11/27 21:25:40 deraadt Exp $ */ /* * Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se> @@ -78,7 +78,7 @@ badchars(char *base) for (s = base; *s; s++) { if (*s == '&') ampr++; - if (!isprint(*s)) + if (!isprint((unsigned char)*s)) return 1; if (strchr(":\n\t\r", *s)) return 1; diff --git a/libexec/spamd/grey.c b/libexec/spamd/grey.c index 70481c16d9b..f085832b598 100644 --- a/libexec/spamd/grey.c +++ b/libexec/spamd/grey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grey.c,v 1.54 2013/11/19 18:33:57 deraadt Exp $ */ +/* $OpenBSD: grey.c,v 1.55 2013/11/27 21:25:25 deraadt Exp $ */ /* * Copyright (c) 2004-2006 Bob Beck. All rights reserved. @@ -319,7 +319,7 @@ dequotetolower(const char *addr) *cp = '\0'; cp = buf; while (*cp != '\0') { - *cp = tolower(*cp); + *cp = tolower((unsigned char)*cp); cp++; } return(buf); @@ -341,9 +341,9 @@ readsuffixlists(void) if ((fp = fopen(alloweddomains_file, "r")) != NULL) { while ((buf = fgetln(fp, &len))) { /* strip white space-characters */ - while (len > 0 && isspace(buf[len-1])) + while (len > 0 && isspace((unsigned char)buf[len-1])) len--; - while (len > 0 && isspace(*buf)) { + while (len > 0 && isspace((unsigned char)*buf)) { buf++; len--; } diff --git a/libexec/talkd/process.c b/libexec/talkd/process.c index 6d2df621f04..49c627e0f28 100644 --- a/libexec/talkd/process.c +++ b/libexec/talkd/process.c @@ -1,4 +1,4 @@ -/* $OpenBSD: process.c,v 1.19 2009/10/27 23:59:31 deraadt Exp $ */ +/* $OpenBSD: process.c,v 1.20 2013/11/27 21:25:24 deraadt Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -81,7 +81,7 @@ process_request(CTL_MSG *mp, CTL_RESPONSE *rp) return; } for (s = mp->l_name; *s; s++) - if (!isprint(*s)) { + if (!isprint((unsigned char)*s)) { syslog(LOG_NOTICE, "Illegal user name. Aborting"); rp->answer = FAILED; return; |