while (*cp == ' ')
cp++;
content_len = 0;
- while (*cp && isdigit(*cp))
+ while (*cp && isdigit(*(const unsigned char *)cp))
content_len = content_len*10 + (*cp++ - '0');
if (content_len < 0) /* prevent negative offsets */
content_len = 0;
return 0;
*(value++) = '\0';
h->name = nmem_strdup(c->nmem, p);
- while (isspace(*value))
+ while (isspace(*(const unsigned char *) value))
value++;
if (value >= p2) // Empty header;
{
/** \brief removes leading whitespace.. Removes suffix cahrs in rm_chars */
char * normalize7bit_generic(char * str, const char * rm_chars)
{
- unsigned char *p, *pe;
- for (p = str; *p && isspace(*p); p++)
+ char *p, *pe;
+ for (p = str; *p && isspace(*(unsigned char *)p); p++)
;
for (pe = p + strlen(p) - 1;
pe > p && strchr(rm_chars, *pe); pe--)
char * normalize7bit_mergekey(char *buf, int skiparticle)
{
- unsigned char *p = buf, *pout = buf;
+ char *p = buf, *pout = buf;
if (skiparticle)
{
char firstword[64];
char articles[] = "the den der die des an a "; // must end in space
- while (*p && !isalnum(*p))
+ while (*p && !isalnum(*(unsigned char *)p))
p++;
pout = firstword;
while (*p && *p != ' ' && pout - firstword < 62)
- *(pout++) = tolower(*(p++));
+ *(pout++) = tolower(*(unsigned char *)(p++));
*(pout++) = ' ';
*(pout++) = '\0';
if (!strstr(articles, firstword))
while (*p)
{
- while (*p && !isalnum(*p))
+ while (*p && !isalnum(*(unsigned char *)p))
p++;
- while (isalnum(*p))
- *(pout++) = tolower(*(p++));
+ while (isalnum(*(unsigned char *)p))
+ *(pout++) = tolower(*(unsigned char *)(p++));
if (*p)
*(pout++) = ' ';
- while (*p && !isalnum(*p))
+ while (*p && !isalnum(*(unsigned char *)p))
p++;
}
if (buf != pout)