diff options
author | pjd <pjd@FreeBSD.org> | 2013-08-18 11:25:42 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2013-08-18 11:25:42 +0000 |
commit | 92598e5bb7bceae383734e69877709b2af64aa6a (patch) | |
tree | 3ca44b0af79cfc051c1d3e81f5d5e3483851feda | |
parent | 5696218306eec632c164897e7fac012d4eef5327 (diff) | |
download | FreeBSD-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
-rw-r--r-- | usr.sbin/rwhod/rwhod.c | 5 |
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++; } |