summaryrefslogtreecommitdiff
path: root/sbin/newfs/newfs.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2013-11-22 04:12:49 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2013-11-22 04:12:49 +0000
commitf34a9f0a9d06ba7a8b2ff945df3a26db7970c69b (patch)
treed57205672d49f3cdb33f1fc9a1a8f910adf8c9f9 /sbin/newfs/newfs.c
parent04e705a232d9b6abc44accfde7b9a33fe3e19510 (diff)
Whole bunch of (unsigned char) casts carefully added for ctype calls.
Careful second audit by millert
Diffstat (limited to 'sbin/newfs/newfs.c')
-rw-r--r--sbin/newfs/newfs.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c
index d0cb25b6481..c38de189fb0 100644
--- a/sbin/newfs/newfs.c
+++ b/sbin/newfs/newfs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: newfs.c,v 1.94 2013/11/05 00:51:58 krw Exp $ */
+/* $OpenBSD: newfs.c,v 1.95 2013/11/22 04:12:48 deraadt Exp $ */
/* $NetBSD: newfs.c,v 1.20 1996/05/16 07:13:03 thorpej Exp $ */
/*
@@ -273,7 +273,7 @@ main(int argc, char *argv[])
fatal("file system size invalid: %s", optarg);
fssize_usebytes = 0; /* in case of multiple -s */
for (s1 = optarg; *s1 != '\0'; s1++)
- if (isalpha(*s1)) {
+ if (isalpha((unsigned char)*s1)) {
fssize_usebytes = 1;
break;
}
@@ -406,11 +406,11 @@ main(int argc, char *argv[])
cp = strchr(argv[0], '\0') - 1;
if (cp == NULL ||
((*cp < 'a' || *cp > ('a' + maxpartitions - 1))
- && !isdigit(*cp)))
+ && !isdigit((unsigned char)*cp)))
fatal("%s: can't figure out file system partition",
argv[0]);
lp = getdisklabel(special, fsi);
- if (isdigit(*cp))
+ if (isdigit((unsigned char)*cp))
pp = &lp->d_partitions[0];
else
pp = &lp->d_partitions[*cp - 'a'];
@@ -611,7 +611,7 @@ rewritelabel(char *s, int fd, struct disklabel *lp)
strncpy(specname, s, sizeof(specname) - 1);
specname[sizeof(specname) - 1] = '\0';
cp = specname + strlen(specname) - 1;
- if (!isdigit(*cp))
+ if (!isdigit((unsigned char)*cp))
*cp = 'c';
cfd = open(specname, O_WRONLY);
if (cfd < 0)