diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c index f4645f9d9..bf5a8d13b 100644 --- a/hw/xfree86/parser/scan.c +++ b/hw/xfree86/parser/scan.c @@ -340,10 +340,10 @@ xf86getToken(const xf86ConfigSymTabRec * tab) } /* GJA -- handle '-' and ',' * Be careful: "-hsync" is a keyword. */ - else if ((c == ',') && !isalpha(configBuf[configPos])) { + else if ((c == ',') && !isalpha((unsigned char)configBuf[configPos])) { return COMMA; } - else if ((c == '-') && !isalpha(configBuf[configPos])) { + else if ((c == '-') && !isalpha((unsigned char)configBuf[configPos])) { return DASH; } @@ -1034,8 +1034,8 @@ xf86nameCompare(const char *s1, const char *s2) s1++; while (*s2 == '_' || *s2 == ' ' || *s2 == '\t') s2++; - c1 = (isupper(*s1) ? tolower(*s1) : *s1); - c2 = (isupper(*s2) ? tolower(*s2) : *s2); + c1 = (isupper((unsigned char)*s1) ? tolower((unsigned char)*s1) : *s1); + c2 = (isupper((unsigned char)*s2) ? tolower((unsigned char)*s2) : *s2); while (c1 == c2) { if (c1 == '\0') return 0; @@ -1045,8 +1045,8 @@ xf86nameCompare(const char *s1, const char *s2) s1++; while (*s2 == '_' || *s2 == ' ' || *s2 == '\t') s2++; - c1 = (isupper(*s1) ? tolower(*s1) : *s1); - c2 = (isupper(*s2) ? tolower(*s2) : *s2); + c1 = (isupper((unsigned char)*s1) ? tolower((unsigned char)*s1) : *s1); + c2 = (isupper((unsigned char)*s2) ? tolower((unsigned char)*s2) : *s2); } return c1 - c2; }