aboutsummaryrefslogtreecommitdiffstats
path: root/imap.c
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2004-06-19 01:44:56 +0000
committerMatthias Andree <matthias.andree@gmx.de>2004-06-19 01:44:56 +0000
commit67d5e1e4ca79d86c8beedc8709efb27f83295443 (patch)
treeb8692dc1d527a427787e86e6e1f02f14a5203630 /imap.c
parentad03539e8bf64c9e3393f357857c5c751d682abc (diff)
downloadfetchmail-67d5e1e4ca79d86c8beedc8709efb27f83295443.tar.gz
fetchmail-67d5e1e4ca79d86c8beedc8709efb27f83295443.tar.bz2
fetchmail-67d5e1e4ca79d86c8beedc8709efb27f83295443.zip
Cast arguments of is*() ctype.h functions to unsigned char to be 8-bit safe.
svn path=/trunk/; revision=3903
Diffstat (limited to 'imap.c')
-rw-r--r--imap.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/imap.c b/imap.c
index d7f0b83f..f1b516ee 100644
--- a/imap.c
+++ b/imap.c
@@ -53,8 +53,8 @@ static int imap_ok(int sock, char *argbuf)
/* all tokens in responses are caseblind */
for (cp = buf; *cp; cp++)
- if (islower(*cp))
- *cp = toupper(*cp);
+ if (islower((unsigned char)*cp))
+ *cp = toupper((unsigned char)*cp);
/* interpret untagged status responses */
if (strstr(buf, "* CAPABILITY"))
@@ -137,9 +137,9 @@ static int imap_ok(int sock, char *argbuf)
char *cp;
/* skip the tag */
- for (cp = buf; !isspace(*cp); cp++)
+ for (cp = buf; !isspace((unsigned char)*cp); cp++)
continue;
- while (isspace(*cp))
+ while (isspace((unsigned char)*cp))
cp++;
if (strncasecmp(cp, "OK", 2) == 0)
@@ -747,7 +747,7 @@ static int imap_getrange(int sock,
while (*cp && unseen < count)
{
/* skip whitespace */
- while (*cp && isspace(*cp))
+ while (*cp && isspace((unsigned char)*cp))
cp++;
if (*cp)
{
@@ -894,9 +894,9 @@ static int imap_is_old(int sock, struct query *ctl, int number)
static char *skip_token(char *ptr)
{
- while(isspace(*ptr)) ptr++;
- while(!isspace(*ptr) && !iscntrl(*ptr)) ptr++;
- while(isspace(*ptr)) ptr++;
+ while(isspace((unsigned char)*ptr)) ptr++;
+ while(!isspace((unsigned char)*ptr) && !iscntrl((unsigned char)*ptr)) ptr++;
+ while(isspace((unsigned char)*ptr)) ptr++;
return(ptr);
}