diff options
| author | dsl <dsl@NetBSD.org> | 2004-11-04 07:38:43 +0000 |
|---|---|---|
| committer | dsl <dsl@NetBSD.org> | 2004-11-04 07:38:43 +0000 |
| commit | df38245ceeba53bead015a2adde84c6d762989f2 (patch) | |
| tree | 2faa90e6b5e2cf281c4ba920a6cb5f1151be38d2 | |
| parent | 7f6459c7a3d8b60dad0bb6db0571fad01e9f4f90 (diff) | |
Add (unsigned char) cast to ctype functions
| -rw-r--r-- | usr.bin/units/units.c | 4 | ||||
| -rw-r--r-- | usr.bin/uudecode/uudecode.c | 8 | ||||
| -rw-r--r-- | usr.bin/vgrind/regexp.c | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/usr.bin/units/units.c b/usr.bin/units/units.c index 99ac3e8dfe0..3c5513e4eb6 100644 --- a/usr.bin/units/units.c +++ b/usr.bin/units/units.c @@ -1,4 +1,4 @@ -/* $NetBSD: units.c,v 1.13 2003/12/05 22:26:43 mycroft Exp $ */ +/* $NetBSD: units.c,v 1.14 2004/11/04 07:38:43 dsl Exp $ */ /* * units.c Copyright (c) 1993 by Adrian Mariano (adrian@cam.cornell.edu) @@ -316,7 +316,7 @@ addunit(struct unittype * theunit, char *toadd, int flip) savescr = scratch = dupstr(toadd); for (slash = scratch + 1; *slash; slash++) if (*slash == '-' && - (tolower(*(slash - 1)) != 'e' || + (tolower((unsigned char)*(slash - 1)) != 'e' || !strchr(".0123456789", *(slash + 1)))) *slash = ' '; slash = strchr(scratch, '/'); diff --git a/usr.bin/uudecode/uudecode.c b/usr.bin/uudecode/uudecode.c index 78ae023b26f..66709d28cef 100644 --- a/usr.bin/uudecode/uudecode.c +++ b/usr.bin/uudecode/uudecode.c @@ -1,4 +1,4 @@ -/* $NetBSD: uudecode.c,v 1.18 2003/10/27 00:12:43 lukem Exp $ */ +/* $NetBSD: uudecode.c,v 1.19 2004/11/04 07:43:38 dsl Exp $ */ /*- * Copyright (c) 1983, 1993 @@ -40,7 +40,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\ #if 0 static char sccsid[] = "@(#)uudecode.c 8.2 (Berkeley) 4/2/94"; #endif -__RCSID("$NetBSD: uudecode.c,v 1.18 2003/10/27 00:12:43 lukem Exp $"); +__RCSID("$NetBSD: uudecode.c,v 1.19 2004/11/04 07:43:38 dsl Exp $"); #endif /* not lint */ /* @@ -127,13 +127,13 @@ decode() } while (strncmp(buf, "begin ", 6)); /* must be followed by an octal mode and a space */ mode = strtol(buf + 6, &fn, 8); - if (fn == (buf+6) || !isspace(*fn) || mode==LONG_MIN || mode==LONG_MAX) + if (fn == (buf+6) || !isspace((unsigned char)*fn) || mode==LONG_MIN || mode==LONG_MAX) { warnx("%s: invalid mode on \"begin\" line", filename); return(1); } /* skip whitespace for file name */ - while (*fn && isspace(*fn)) fn++; + while (*fn && isspace((unsigned char)*fn)) fn++; if (*fn == 0) { warnx("%s: no filename on \"begin\" line", filename); return(1); diff --git a/usr.bin/vgrind/regexp.c b/usr.bin/vgrind/regexp.c index 71c2d309a63..c4095a3546b 100644 --- a/usr.bin/vgrind/regexp.c +++ b/usr.bin/vgrind/regexp.c @@ -1,4 +1,4 @@ -/* $NetBSD: regexp.c,v 1.7 2003/08/07 11:17:01 agc Exp $ */ +/* $NetBSD: regexp.c,v 1.8 2004/11/04 07:44:47 dsl Exp $ */ /* * Copyright (c) 1980, 1993 @@ -40,7 +40,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\ #if 0 static char sccsid[] = "@(#)regexp.c 8.1 (Berkeley) 6/6/93"; #endif -__RCSID("$NetBSD: regexp.c,v 1.7 2003/08/07 11:17:01 agc Exp $"); +__RCSID("$NetBSD: regexp.c,v 1.8 2004/11/04 07:44:47 dsl Exp $"); #endif /* not lint */ #include <ctype.h> @@ -58,7 +58,7 @@ boolean x_escaped; /* true if we are currently x_escaped */ char *x_start; /* start of string */ boolean l_onecase; /* true if upper and lower equivalent */ -#define makelower(c) (isupper((unsigned char)(c)) ? tolower((c)) : (c)) +#define makelower(c) (isupper((unsigned char)(c)) ? tolower((unsigned char)(c)) : (c)) /* STRNCMP - like strncmp except that we convert the * first string to lower case before comparing |
