summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rwhod
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2013-08-18 11:25:42 +0000
committerpjd <pjd@FreeBSD.org>2013-08-18 11:25:42 +0000
commit92598e5bb7bceae383734e69877709b2af64aa6a (patch)
tree3ca44b0af79cfc051c1d3e81f5d5e3483851feda /usr.sbin/rwhod
parent5696218306eec632c164897e7fac012d4eef5327 (diff)
downloadFreeBSD-src-92598e5bb7bceae383734e69877709b2af64aa6a.zip
FreeBSD-src-92598e5bb7bceae383734e69877709b2af64aa6a.tar.gz
Cast argument of is*() ctype functions to unsigned char.
Without the cast there is ambiguity between 0xFF and -1 (EOF). Suggested by: jilles Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org> Sponsored by: Google Summer of Code 2013
Diffstat (limited to 'usr.sbin/rwhod')
-rw-r--r--usr.sbin/rwhod/rwhod.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/rwhod/rwhod.c b/usr.sbin/rwhod/rwhod.c
index d6a597f..25b8692 100644
--- a/usr.sbin/rwhod/rwhod.c
+++ b/usr.sbin/rwhod/rwhod.c
@@ -337,8 +337,11 @@ verify(char *name, int maxlen)
size = 0;
while (*name != '\0' && size < maxlen - 1) {
- if (!isascii(*name) || !(isalnum(*name) || ispunct(*name)))
+ if (!isascii((unsigned char)*name) ||
+ !(isalnum((unsigned char)*name) ||
+ ispunct((unsigned char)*name))) {
return (0);
+ }
name++;
size++;
}
OpenPOWER on IntegriCloud