summaryrefslogtreecommitdiff
path: root/usr.bin/chpass
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2013-11-26 13:19:08 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2013-11-26 13:19:08 +0000
commit9c87bfa9d5ea46fd4fe5c8edb947aec28e748573 (patch)
tree8be8e4e1654412e91168bb2f405a3a753d0c8972 /usr.bin/chpass
parent60adb56e9c39b26c1401c07dc1d1c8f79489daed (diff)
unsigned char casts for ctype
ok krw
Diffstat (limited to 'usr.bin/chpass')
-rw-r--r--usr.bin/chpass/edit.c7
-rw-r--r--usr.bin/chpass/field.c6
2 files changed, 7 insertions, 6 deletions
diff --git a/usr.bin/chpass/edit.c b/usr.bin/chpass/edit.c
index e25e46344a6..2590d4c42d1 100644
--- a/usr.bin/chpass/edit.c
+++ b/usr.bin/chpass/edit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: edit.c,v 1.33 2009/10/27 23:59:36 deraadt Exp $ */
+/* $OpenBSD: edit.c,v 1.34 2013/11/26 13:18:55 deraadt Exp $ */
/* $NetBSD: edit.c,v 1.6 1996/05/15 21:50:45 jtc Exp $ */
/*-
@@ -173,8 +173,9 @@ verify(char *tempname, struct passwd *pw)
warnx("line %u corrupted", line);
goto bad;
}
- while (isspace(*++p));
- for (q = p; isprint(*q); q++) {
+ while (isspace((unsigned char)*++p))
+ ;
+ for (q = p; isprint((unsigned char)*q); q++) {
if (ep->except && strchr(ep->except,*q))
break;
}
diff --git a/usr.bin/chpass/field.c b/usr.bin/chpass/field.c
index 27a61edb46b..b48c7951e5a 100644
--- a/usr.bin/chpass/field.c
+++ b/usr.bin/chpass/field.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: field.c,v 1.12 2009/10/27 23:59:36 deraadt Exp $ */
+/* $OpenBSD: field.c,v 1.13 2013/11/26 13:18:55 deraadt Exp $ */
/* $NetBSD: field.c,v 1.3 1995/03/26 04:55:28 glass Exp $ */
/*
@@ -69,7 +69,7 @@ p_login(char *p, struct passwd *pw, ENTRY *ep)
if (strchr(p, '.'))
warnx("\'.\' is dangerous in a login name");
for (; *p; ++p)
- if (isupper(*p)) {
+ if (isupper((unsigned char)*p)) {
warnx("upper-case letters are dangerous in a login name");
break;
}
@@ -122,7 +122,7 @@ p_gid(char *p, struct passwd *pw, ENTRY *ep)
warnx("empty gid field");
return (1);
}
- if (!isdigit(*p)) {
+ if (!isdigit((unsigned char)*p)) {
if (!(gr = getgrnam(p))) {
warnx("unknown group %s", p);
return (1);