static int check_alias_name_char (char c)
{
return (c == '-' || c == '_' || c == '+' || c == '=' || c == '.' ||
- isalnum (c));
+ isalnum ((unsigned char) c));
}
int mutt_check_alias_name (const char *s, char *d)
ADDRESS *a = NULL;
- switch (tolower (*s))
+ switch (tolower ((unsigned char) *s))
{
case 'r':
{
return 1;
/* quoted-printable triple */
- if (*s == '=' && isxdigit (*(s+1)) && isxdigit (*(s+2)))
+ if (*s == '=' &&
+ isxdigit ((unsigned char) *(s+1)) &&
+ isxdigit ((unsigned char) *(s+2)))
{
*d = (hexval (*(s+1)) << 4) | hexval (*(s+2));
return 0;
s = imap_next_word (idata->cmd.buf);
- if ((idata->state == IMAP_SELECTED) && isdigit (*s))
+ if ((idata->state == IMAP_SELECTED) && isdigit ((unsigned char) *s))
{
pn = s;
s = imap_next_word (s);
/* zero out current rights set */
memset (idata->rights, 0, sizeof (idata->rights));
- while (*s && !isspace(*s))
+ while (*s && !isspace((unsigned char) *s))
{
switch (*s)
{
{
s = imap_next_word (s);
s = imap_next_word (s);
- if (isdigit (*s))
+ if (isdigit ((unsigned char) *s))
{
if (*s != '0')
{
s += 11;
SKIPWS (s);
ptmp = tmp;
- while (isdigit (*s))
+ while (isdigit ((unsigned char) *s))
*ptmp++ = *s++;
*ptmp = 0;
h->content_length = atoi (tmp);
return (-1);
pc++;
pn = pc;
- while (isdigit (*pc))
+ while (isdigit ((unsigned char) *pc))
pc++;
*pc = 0;
*bytes = atoi(pn);
case 'C':
if (!*tok->dptr)
return -1; /* premature end of token */
- mutt_buffer_addch (dest, (toupper (*tok->dptr) - '@') & 0x7f);
+ mutt_buffer_addch (dest, (toupper ((unsigned char) *tok->dptr)
+ - '@') & 0x7f);
tok->dptr++;
break;
case 'r':
else if (ch == '[')
mutt_buffer_addch (dest, '\033');
else if (isalpha ((unsigned char) ch))
- mutt_buffer_addch (dest, toupper (ch) - '@');
+ mutt_buffer_addch (dest, toupper ((unsigned char) ch) - '@');
else
{
mutt_buffer_addch (dest, '^');
size_t cnt;
for (cnt = 0; cnt < name_len; ++cnt)
- if (isalnum (codeset[cnt]))
+ if (isalnum ((unsigned char) codeset[cnt]))
{
++len;
- if (isalpha (codeset[cnt]))
+ if (isalpha ((unsigned char) codeset[cnt]))
only_digit = 0;
}
wp = retval;
for (cnt = 0; cnt < name_len; ++cnt)
- if (isalpha (codeset[cnt]))
- *wp++ = tolower (codeset[cnt]);
- else if (isdigit (codeset[cnt]))
+ if (isalpha ((unsigned char) codeset[cnt]))
+ *wp++ = tolower ((unsigned char) codeset[cnt]);
+ else if (isdigit ((unsigned char) codeset[cnt]))
*wp++ = codeset[cnt];
*wp = '\0';
struct parse_args args;
nplurals += 9;
- while (*nplurals != '\0' && isspace (*nplurals))
+ while (*nplurals != '\0' && isspace ((unsigned char) *nplurals))
++nplurals;
#if defined HAVE_STRTOUL || defined _LIBC
n = strtoul (nplurals, &endp, 10);
cp = buf;
/* Ignore leading white space. */
- while (isspace (cp[0]))
+ while (isspace ((unsigned char) cp[0]))
++cp;
/* A leading '#' signals a comment line. */
if (cp[0] != '\0' && cp[0] != '#')
{
alias = cp++;
- while (cp[0] != '\0' && !isspace (cp[0]))
+ while (cp[0] != '\0' && !isspace ((unsigned char) cp[0]))
++cp;
/* Terminate alias name. */
if (cp[0] != '\0')
*cp++ = '\0';
/* Now look for the beginning of the value. */
- while (isspace (cp[0]))
+ while (isspace ((unsigned char) cp[0]))
++cp;
if (cp[0] != '\0')
size_t value_len;
value = cp++;
- while (cp[0] != '\0' && !isspace (cp[0]))
+ while (cp[0] != '\0' && !isspace ((unsigned char) cp[0]))
++cp;
/* Terminate value. */
if (cp[0] == '\n')
*/
static int parse_keycode (const char *s)
{
- if (isdigit (s[1]) && isdigit (s[2]) && isdigit (s[3]) && s[4] == '>')
+ if (isdigit ((unsigned char) s[1]) &&
+ isdigit ((unsigned char) s[2]) &&
+ isdigit ((unsigned char) s[3]) &&
+ s[4] == '>')
{
return (s[3] - '0') + (s[2] - '0') * 8 + (s[1] - '0') * 64;
}
while (*p)
{
- *p = tolower (*p);
+ *p = tolower ((unsigned char) *p);
p++;
}
while (*(p = haystack))
{
- for (q = needle; *p && *q && tolower (*p) == tolower (*q); p++, q++)
+ for (q = needle;
+ *p && *q &&
+ tolower ((unsigned char) *p) == tolower ((unsigned char) *q);
+ p++, q++)
;
if (!*q)
return (haystack);
static char *skip_ws (char *s)
{
- while (*s && isspace (*s))
+ while (*s && isspace ((unsigned char) *s))
s++;
return s;
}
else if (!is_quoted && strchr (single_char_tokens, *t))
break;
- else if (!is_quoted && isspace (*t))
+ else if (!is_quoted && isspace ((unsigned char) *t))
break;
else
*d++ = *t;
{
/* heuristic! */
strncpy (t, s + 5, l);
- for (; *t; t++) *t = tolower (*t);
+ for (; *t; t++) *t = tolower ((unsigned char) *t);
break;
}
case DT_MAGIC:
{
/* heuristic! */
strncpy (t, s + 2, l);
- for (; *t; t++) *t = tolower (*t);
+ for (; *t; t++) *t = tolower ((unsigned char) *t);
break;
}
case DT_STR:
else
{
ref = s;
- while (isalnum (*s) || *s == '-' || *s == '_')
+ while (isalnum ((unsigned char) *s) || *s == '-' || *s == '_')
++s;
docstat = commit_buff (buff, &d, out, docstat);
memmove (&dest[idx + pwnl], &dest[idx + 1],
MAX(destlen - idx - pwnl - 1, 0));
memcpy (&dest[idx], pw->pw_name, MIN(destlen - idx - 1, pwnl));
- dest[idx] = toupper (dest[idx]);
+ dest[idx] = toupper ((unsigned char) dest[idx]);
}
}
}
else
pat->min = strtol (s->dptr, &tmp, 0);
- if (toupper (*tmp) == 'K') /* is there a prefix? */
+ if (toupper ((unsigned char) *tmp) == 'K') /* is there a prefix? */
{
pat->min *= 1024;
tmp++;
}
- else if (toupper (*tmp) == 'M')
+ else if (toupper ((unsigned char) *tmp) == 'M')
{
pat->min *= 1048576;
tmp++;
{
/* range maximum */
pat->max = strtol (tmp, &tmp, 0);
- if (toupper (*tmp) == 'K')
+ if (toupper ((unsigned char) *tmp) == 'K')
{
pat->max *= 1024;
tmp++;
}
- else if (toupper (*tmp) == 'M')
+ else if (toupper ((unsigned char) *tmp) == 'M')
{
pat->max *= 1048576;
tmp++;
charset[t-pp] = '\0';
break;
case 3:
- if (toupper (*pp) == 'Q')
+ if (toupper ((unsigned char) *pp) == 'Q')
enc = ENCQUOTEDPRINTABLE;
- else if (toupper (*pp) == 'B')
+ else if (toupper ((unsigned char) *pp) == 'B')
enc = ENCBASE64;
else
{
else
{
*s = '\0'; s++; /* let s point to the first character of index. */
- for (t = s; *t && isdigit (*t); t++)
+ for (t = s; *t && isdigit ((unsigned char) *t); t++)
;
encoded = (*t == '*');
*t = '\0';
for (d = dest; *src; src++)
{
- if (*src == '%' && isxdigit (*(src + 1)) && isxdigit (*(src + 2)))
+ if (*src == '%' &&
+ isxdigit ((unsigned char) *(src + 1)) &&
+ isxdigit ((unsigned char) *(src + 2)))
{
*d++ = (hexval (*(src + 1)) << 4) | (hexval (*(src + 2)));
src += 2;
}
while (*s)
{
- if (ISSPACE (*s) || is_special (*s))
+ if (ISSPACE ((unsigned char) *s) || is_special (*s))
break;
if (*tokenlen < tokenmax)
token[(*tokenlen)++] = *s;
while (last && last->next)
last = last->next;
- ws_pending = isspace (*s);
+ ws_pending = isspace ((unsigned char) *s);
SKIPWS (s);
begin = s;
}
s = ps;
}
- ws_pending = isspace (*s);
+ ws_pending = isspace ((unsigned char) *s);
SKIPWS (s);
}
while (*s1 && *s2 && l < n)
{
- c1 = tolower (*s1);
- c2 = tolower (*s2);
+ c1 = tolower ((unsigned char) *s1);
+ c2 = tolower ((unsigned char) *s2);
if (c1 != c2)
return (c1 - c2);
s1++;
while (*s1 && *s2)
{
- c1 = tolower (*s1);
- c2 = tolower (*s2);
+ c1 = tolower ((unsigned char) *s1);
+ c2 = tolower ((unsigned char) *s2);
if (c1 != c2)
return (c1 - c2);
s1++;
for (d = s; *s; s++)
{
if (*s == '%' && s[1] && s[2] &&
- isxdigit (s[1]) && isxdigit (s[2]) &&
+ isxdigit ((unsigned char) s[1]) &&
+ isxdigit ((unsigned char) s[2]) &&
hexval (s[1]) >= 0 && hexval (s[2]) >= 0)
{
*d++ = (hexval (s[1]) << 4) | (hexval (s[2]));