mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-28 04:43:32 +00:00
Avoid passing negative values to <ctype.h> functions on machines with
signed chars.
This commit is contained in:
parent
f1f7aaab59
commit
911a3ff97b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=132240
@ -344,7 +344,7 @@ getprec(char *str)
|
||||
if (!*p)
|
||||
return (0);
|
||||
for (q = ++p; *p; p++)
|
||||
if (!isdigit(*p))
|
||||
if (!isdigit((unsigned char)*p))
|
||||
break;
|
||||
return (p - q);
|
||||
}
|
||||
@ -381,8 +381,8 @@ getformat(void)
|
||||
*/
|
||||
p2 = p++;
|
||||
dot = hash = space = sign = numbers = 0;
|
||||
while (!isalpha(*p)) {
|
||||
if (isdigit(*p)) {
|
||||
while (!isalpha((unsigned char)*p)) {
|
||||
if (isdigit((unsigned char)*p)) {
|
||||
numbers++;
|
||||
p++;
|
||||
} else if ((*p == '#' && !(numbers|dot|sign|space|
|
||||
|
Loading…
Reference in New Issue
Block a user