int i;
for (i = 0; i < len; i++)
- if (tolower(name1[i]) != tolower(name2[i]))
+ if (tolower((unsigned char)name1[i]) != tolower((unsigned char)name2[i]))
return -1;
return 0;
}
if (!skip_update) {
/* turn it to lower case if needed */
if (isupper((unsigned char)*ptr) && h1m->flags & H1_MF_TOLOWER)
- *ptr = tolower(*ptr);
+ *ptr = tolower((unsigned char)*ptr);
}
EAT_AND_JUMP_OR_RETURN(ptr, end, http_msg_hdr_name, http_msg_ood, state, H1_MSG_HDR_NAME);
}
icase = expr->mflags & PAT_MF_IGNORE_CASE;
if (icase) {
for (c = smp->data.u.str.area; c <= end; c++) {
- if (tolower(*c) != tolower(*pattern->ptr.str))
+ if (tolower((unsigned char)*c) != tolower((unsigned char)*pattern->ptr.str))
continue;
if (strncasecmp(pattern->ptr.str, c, pattern->len) == 0) {
ret = pattern;
continue;
if (icase) {
- if ((tolower(*c) == tolower(*ps)) &&
+ if ((tolower((unsigned char)*c) == tolower((unsigned char)*ps)) &&
(strncasecmp(ps, c, pl) == 0) &&
(c == end || is_delimiter(c[pl], delimiters)))
return PAT_MATCH;
if (!*str)
return -1;
- hex1 = toupper(*str++) - '0';
+ hex1 = toupper((unsigned char)*str++) - '0';
if (!*str)
return -1;
- hex2 = toupper(*str++) - '0';
+ hex2 = toupper((unsigned char)*str++) - '0';
if (hex1 > 9) hex1 -= 'A' - '9' - 1;
if (hex2 > 9) hex2 -= 'A' - '9' - 1;
for (i = 0; i < trash.size; i++) {
if (!servername[i])
break;
- trash.area[i] = tolower(servername[i]);
+ trash.area[i] = tolower((unsigned char)servername[i]);
if (!wildp && (trash.area[i] == '.'))
wildp = &trash.area[i];
}
int j, len;
len = strlen(name);
for (j = 0; j < len && j < trash.size; j++)
- trash.area[j] = tolower(name[j]);
+ trash.area[j] = tolower((unsigned char)name[j]);
if (j >= trash.size)
return -1;
trash.area[j] = 0;
for (i = 0; i < trash.size; i++) {
if (!str[i])
break;
- trash.area[i] = tolower(str[i]);
+ trash.area[i] = tolower((unsigned char)str[i]);
}
trash.area[i] = 0;
node = ebst_lookup(sni_keytypes, trash.area);
return NULL;
for (tmp1 = 0, start = (char *)str1, pptr = (char *)str2, slen = len_str1, plen = len_str2; slen >= plen; start++, slen--) {
- while (toupper(*start) != toupper(*str2)) {
+ while (toupper((unsigned char)*start) != toupper((unsigned char)*str2)) {
start++;
slen--;
tmp1++;
pptr = (char *)str2;
tmp2 = 0;
- while (toupper(*sptr) == toupper(*pptr)) {
+ while (toupper((unsigned char)*sptr) == toupper((unsigned char)*pptr)) {
sptr++;
pptr++;
tmp2++;
*errptr = in;
goto leave;
}
- hex1 = toupper(in[2]) - '0';
- hex2 = toupper(in[3]) - '0';
+ hex1 = toupper((unsigned char)in[2]) - '0';
+ hex2 = toupper((unsigned char)in[3]) - '0';
if (hex1 > 9) hex1 -= 'A' - '9' - 1;
if (hex2 > 9) hex2 -= 'A' - '9' - 1;
tosend = (hex1 << 4) + hex2;