From 9c87bfa9d5ea46fd4fe5c8edb947aec28e748573 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Tue, 26 Nov 2013 13:19:08 +0000 Subject: unsigned char casts for ctype ok krw --- usr.bin/chpass/edit.c | 7 ++++--- usr.bin/chpass/field.c | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'usr.bin/chpass') 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); -- cgit v1.2.3