diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-11-26 19:25:40 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-11-26 19:25:40 +0000 |
commit | 1113d1cd1f9d36060950443e3c2408223870610c (patch) | |
tree | 47477f2a5ccfd2e6892bce4543fd5ed0e57f4c66 /usr.bin | |
parent | 4ad36533b573710998fc58a75257f9c97157b382 (diff) |
unsigned char casts for ctype
ok okan
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/radioctl/radioctl.c | 4 | ||||
-rw-r--r-- | usr.bin/uniq/uniq.c | 6 | ||||
-rw-r--r-- | usr.bin/vacation/vacation.c | 16 | ||||
-rw-r--r-- | usr.bin/whatis/whatis.c | 9 |
4 files changed, 18 insertions, 17 deletions
diff --git a/usr.bin/radioctl/radioctl.c b/usr.bin/radioctl/radioctl.c index 2e6f971d2c0..4b903d59a47 100644 --- a/usr.bin/radioctl/radioctl.c +++ b/usr.bin/radioctl/radioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radioctl.c,v 1.17 2010/06/29 05:00:05 tedu Exp $ */ +/* $OpenBSD: radioctl.c,v 1.18 2013/11/26 19:25:38 deraadt Exp $ */ /* $RuOBSD: radioctl.c,v 1.4 2001/10/20 18:09:10 pva Exp $ */ /* @@ -481,7 +481,7 @@ parse_opt(char *s, struct opt_t *o) { o->value = 0; break; default: - if (isdigit(*topt)) + if (isdigit((unsigned char)*topt)) o->value = str_to_int(topt, o->option); break; } diff --git a/usr.bin/uniq/uniq.c b/usr.bin/uniq/uniq.c index 8bcff412f20..7645f85062f 100644 --- a/usr.bin/uniq/uniq.c +++ b/usr.bin/uniq/uniq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uniq.c,v 1.18 2009/10/27 23:59:46 deraadt Exp $ */ +/* $OpenBSD: uniq.c,v 1.19 2013/11/26 19:25:39 deraadt Exp $ */ /* $NetBSD: uniq.c,v 1.7 1995/08/31 22:03:48 jtc Exp $ */ /* @@ -173,9 +173,9 @@ skip(char *str) int nchars, nfields; for (nfields = numfields; nfields && *str; nfields--) { - while (isblank(*str)) + while (isblank((unsigned char)*str)) str++; - while (*str && !isblank(*str)) + while (*str && !isblank((unsigned char)*str)) str++; } for (nchars = numchars; nchars-- && *str && *str != '\n'; ++str) diff --git a/usr.bin/vacation/vacation.c b/usr.bin/vacation/vacation.c index f51e233dd65..4f3e185effe 100644 --- a/usr.bin/vacation/vacation.c +++ b/usr.bin/vacation/vacation.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vacation.c,v 1.33 2013/04/19 14:35:40 okan Exp $ */ +/* $OpenBSD: vacation.c,v 1.34 2013/11/26 19:25:39 deraadt Exp $ */ /* $NetBSD: vacation.c,v 1.7 1995/04/29 05:58:27 cgd Exp $ */ /* @@ -109,7 +109,7 @@ main(int argc, char *argv[]) iflag = 1; break; case 'r': - if (isdigit(*optarg)) { + if (isdigit((unsigned char)*optarg)) { interval = atol(optarg) * SECSPERDAY; if (interval < 0) usage(); @@ -198,7 +198,7 @@ readheaders(void) cont = 0; if (strncasecmp(buf, "Auto-Submitted:", 15)) break; - for (p = buf + 15; isspace(*p); ++p) + for (p = buf + 15; isspace((unsigned char)*p); ++p) ; /* * RFC 3834 section 2: @@ -208,7 +208,7 @@ readheaders(void) */ if ((p[0] == 'n' || p[0] == 'N') && (p[1] == 'o' || p[1] == 'O')) { - for (p += 2; isspace(*p); ++p) + for (p += 2; isspace((unsigned char)*p); ++p) ; if (*p == '\0') break; /* Auto-Submitted: no */ @@ -244,7 +244,7 @@ readheaders(void) sizeof("Return-Path:")-1) || (buf[12] != ' ' && buf[12] != '\t')) break; - for (p = buf + 12; isspace(*p); ++p) + for (p = buf + 12; isspace((unsigned char)*p); ++p) ; if (strlcpy(from, p, sizeof(from)) >= sizeof(from)) { syslog(LOG_NOTICE, @@ -260,7 +260,7 @@ readheaders(void) cont = 0; if (strncasecmp(buf, "Precedence:", 11)) break; - for (p = buf + 11; isspace(*p); ++p) + for (p = buf + 11; isspace((unsigned char)*p); ++p) ; if (!strncasecmp(p, "junk", 4) || !strncasecmp(p, "bulk", 4) || @@ -274,7 +274,7 @@ readheaders(void) sizeof("Subject:")-1) || (buf[8] != ' ' && buf[8] != '\t')) break; - for (p = buf + 8; isspace(*p); ++p) + for (p = buf + 8; isspace((unsigned char)*p); ++p) ; if (strlcpy(subj, p, sizeof(subj)) >= sizeof(subj)) { syslog(LOG_NOTICE, @@ -296,7 +296,7 @@ readheaders(void) cont = 1; goto findme; default: - if (!isspace(*buf) || !cont || tome) { + if (!isspace((unsigned char)*buf) || !cont || tome) { cont = 0; break; } diff --git a/usr.bin/whatis/whatis.c b/usr.bin/whatis/whatis.c index ae6807dad8a..57426fe6df6 100644 --- a/usr.bin/whatis/whatis.c +++ b/usr.bin/whatis/whatis.c @@ -1,4 +1,4 @@ -/* $OpenBSD: whatis.c,v 1.14 2013/11/15 22:20:04 millert Exp $ */ +/* $OpenBSD: whatis.c,v 1.15 2013/11/26 19:25:39 deraadt Exp $ */ /* * Copyright (c) 1987, 1993 @@ -170,13 +170,13 @@ match(char *bp, char *str) return(0); for (len = strlen(str);;) { /* skip leading crud */ - for (; *bp && !isalnum(*bp); ++bp) + for (; *bp && !isalnum((unsigned char)*bp); ++bp) ; if (!*bp) break; /* check for word match first */ - for (start = bp++; *bp == '_' || isalnum(*bp); ++bp) + for (start = bp++; *bp == '_' || isalnum((unsigned char)*bp); ++bp) ; if (bp - start == len) { if (strncasecmp(start, str, len) == 0) @@ -184,7 +184,8 @@ match(char *bp, char *str) } else if (*bp && *bp != ',') { /* check for full string match */ for (bp = start; - *bp && *bp != ',' && *bp != '(' && !isspace(*bp); ++bp) + *bp && *bp != ',' && *bp != '(' && + !isspace((unsigned char)*bp); ++bp) ; if (bp - start == len && strncasecmp(start, str, len) == 0) return(1); |