From 67d5e1e4ca79d86c8beedc8709efb27f83295443 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Sat, 19 Jun 2004 01:44:56 +0000 Subject: Cast arguments of is*() ctype.h functions to unsigned char to be 8-bit safe. svn path=/trunk/; revision=3903 --- imap.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'imap.c') 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); } -- cgit v1.2.3