mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 05:58:57 +00:00
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:
parent
f5ffdfc18b
commit
d92167993d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=254486
@ -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++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user