From 92598e5bb7bceae383734e69877709b2af64aa6a Mon Sep 17 00:00:00 2001 From: pjd Date: Sun, 18 Aug 2013 11:25:42 +0000 Subject: 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 Sponsored by: Google Summer of Code 2013 --- usr.sbin/rwhod/rwhod.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'usr.sbin/rwhod') 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++; } -- cgit v1.1