fix undefined behaviour of use of isalpha, isdigit and tolower
"The argument c must be EOF or representable as an unsigned char; otherwise, the result is undefined."
This commit is contained in:
parent
bf06f14188
commit
1411224b16
6
ii.c
6
ii.c
@ -140,9 +140,9 @@ static void
|
|||||||
channel_normalize_path(char *s)
|
channel_normalize_path(char *s)
|
||||||
{
|
{
|
||||||
for (; *s; s++) {
|
for (; *s; s++) {
|
||||||
if (isalpha(*s))
|
if (isalpha((unsigned char)*s))
|
||||||
*s = tolower(*s);
|
*s = tolower((unsigned char)*s);
|
||||||
else if (!isdigit(*s) && !strchr(".#&+!-", *s))
|
else if (!isdigit((unsigned char)*s) && !strchr(".#&+!-", *s))
|
||||||
*s = '_';
|
*s = '_';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user