Add (unsigned char) cast to ctype function

This commit is contained in:
dsl 2004-10-29 19:04:39 +00:00
parent 09993d7a4e
commit 9ab983c04a
3 changed files with 13 additions and 13 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: fattr.c,v 1.2 2000/10/30 20:58:20 jdolecek Exp $ */
/* $NetBSD: fattr.c,v 1.3 2004/10/29 19:11:15 dsl Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: fattr.c,v 1.2 2000/10/30 20:58:20 jdolecek Exp $");
__RCSID("$NetBSD: fattr.c,v 1.3 2004/10/29 19:11:15 dsl Exp $");
#endif /* not lint */
#include <sys/cdefs.h>
@ -64,7 +64,7 @@ a_gid(s)
if ((gr = getgrnam(s)) != NULL)
gid = gr->gr_gid;
else {
for (gname = s; *s && isdigit(*s); ++s);
for (gname = s; *s && isdigit((unsigned char)*s); ++s);
if (!*s)
gid = atoi(gname);
else
@ -84,7 +84,7 @@ a_uid(s)
if ((pw = getpwnam(s)) != NULL)
uid = pw->pw_uid;
else {
for (uname = s; *s && isdigit(*s); ++s);
for (uname = s; *s && isdigit((unsigned char)*s); ++s);
if (!*s)
uid = atoi(uname);
else

View File

@ -1,4 +1,4 @@
/* $NetBSD: newfs.c,v 1.13 2003/08/12 08:41:37 dsl Exp $ */
/* $NetBSD: newfs.c,v 1.14 2004/10/29 19:04:39 dsl Exp $ */
/*-
* Copyright (c) 1989, 1992, 1993
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1992, 1993\n\
#if 0
static char sccsid[] = "@(#)newfs.c 8.5 (Berkeley) 5/24/95";
#else
__RCSID("$NetBSD: newfs.c,v 1.13 2003/08/12 08:41:37 dsl Exp $");
__RCSID("$NetBSD: newfs.c,v 1.14 2004/10/29 19:04:39 dsl Exp $");
#endif
#endif /* not lint */
@ -305,7 +305,7 @@ main(int argc, char **argv)
cp = strchr(argv[0], '\0') - 1;
if (!debug
&& ((*cp < 'a' || *cp > ('a' + maxpartitions - 1))
&& !isdigit(*cp)))
&& !isdigit((unsigned char)*cp)))
fatal("%s: can't figure out file system partition", argv[0]);
#ifdef COMPAT
@ -314,7 +314,7 @@ main(int argc, char **argv)
#endif
lp = getdisklabel(special, fsi);
if (isdigit(*cp))
if (isdigit((unsigned char)*cp))
pp = &lp->d_partitions[0];
else
pp = &lp->d_partitions[*cp - 'a'];

View File

@ -1,4 +1,4 @@
/* $NetBSD: newfs_msdos.c,v 1.17 2004/09/22 23:52:38 thorpej Exp $ */
/* $NetBSD: newfs_msdos.c,v 1.18 2004/10/29 19:07:46 dsl Exp $ */
/*
* Copyright (c) 1998 Robert Nordier
@ -33,7 +33,7 @@
static const char rcsid[] =
"$FreeBSD: src/sbin/newfs_msdos/newfs_msdos.c,v 1.15 2000/10/10 01:49:37 wollman Exp $";
#else
__RCSID("$NetBSD: newfs_msdos.c,v 1.17 2004/09/22 23:52:38 thorpej Exp $");
__RCSID("$NetBSD: newfs_msdos.c,v 1.18 2004/10/29 19:07:46 dsl Exp $");
#endif
#endif /* not lint */
@ -770,11 +770,11 @@ getdiskinfo(int fd, const char *fname, const char *dtype, int oflag,
s1 = fname;
if ((s2 = strrchr(s1, '/')))
s1 = s2 + 1;
for (s2 = s1; *s2 && !isdigit(*s2); s2++);
for (s2 = s1; *s2 && !isdigit((unsigned char)*s2); s2++);
if (!*s2 || s2 == s1)
s2 = NULL;
else
while (isdigit(*++s2));
while (isdigit((unsigned char)*++s2));
s1 = s2;
#ifdef __FreeBSD__
if (s2 && *s2 == 's') {
@ -944,7 +944,7 @@ mklabel(u_int8_t *dest, const char *src)
int c, i;
for (i = 0; i < 11; i++) {
c = *src ? toupper(*src++) : ' ';
c = *src ? toupper((unsigned char)*src++) : ' ';
*dest++ = !i && c == '\xe5' ? 5 : c;
}
}