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
This commit is contained in:
Pawel Jakub Dawidek 2013-08-18 11:25:42 +00:00
parent f5ffdfc18b
commit d92167993d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=254486

View File

@ -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++;
}