Cast arguments to the various ctype functions to unsigned char to match their
documentation.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4203)
(cherry picked from commit
00dfbaad88a69ed8294d6039bf5f7d722f72bf39)
if (n > sizeof prog - 1)
n = sizeof prog - 1;
for (q = prog, i = 0; i < n; i++, p++)
- *q++ = isupper(*p) ? tolower(*p) : *p;
+ *q++ = tolower((unsigned char)*p);
*q = '\0';
return prog;
}
if (q != NULL) {
for (q++; *q != '\0'; q++) {
- if (!isdigit(*q))
+ if (!isdigit((unsigned char)*q))
return 1;
}
}
((ch >= 'a') && (ch <= 'z')) ||
(ch == '-') || (ch == '.') || (ch == '='))
#else
- while (isalnum(ch) || (ch == '-') || (ch == '.') || (ch == '='))
+ while (isalnum((unsigned char)ch) || (ch == '-') || (ch == '.')
+ || (ch == '='))
#endif
{
ch = *(++l);