diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2004-06-19 01:44:56 +0000 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2004-06-19 01:44:56 +0000 |
commit | 67d5e1e4ca79d86c8beedc8709efb27f83295443 (patch) | |
tree | b8692dc1d527a427787e86e6e1f02f14a5203630 /transact.c | |
parent | ad03539e8bf64c9e3393f357857c5c751d682abc (diff) | |
download | fetchmail-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 'transact.c')
-rw-r--r-- | transact.c | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -207,17 +207,17 @@ static char *parse_received(struct query *ctl, char *bufp) { if (!(ok = strstr(base, "by"))) break; - else if (!isspace(ok[-1]) || !isspace(ok[2])) + else if (!isspace((unsigned char)ok[-1]) || !isspace((unsigned char)ok[2])) continue; else { char *sp, *tp; /* extract space-delimited token after "by" */ - for (sp = ok + 2; isspace(*sp); sp++) + for (sp = ok + 2; isspace((unsigned char)*sp); sp++) continue; tp = rbuf; - for (; !isspace(*sp); sp++) + for (; !isspace((unsigned char)*sp); sp++) RBUF_WRITE(*sp); *tp = '\0'; @@ -255,17 +255,17 @@ static char *parse_received(struct query *ctl, char *bufp) { if (!(ok = strstr(base, "for"))) break; - else if (!isspace(ok[-1]) || !isspace(ok[3])) + else if (!isspace((unsigned char)ok[-1]) || !isspace((unsigned char)ok[3])) continue; else { char *sp, *tp; /* extract space-delimited token after "for" */ - for (sp = ok + 3; isspace(*sp); sp++) + for (sp = ok + 3; isspace((unsigned char)*sp); sp++) continue; tp = rbuf; - for (; !isspace(*sp); sp++) + for (; !isspace((unsigned char)*sp); sp++) RBUF_WRITE(*sp); *tp = '\0'; @@ -281,7 +281,7 @@ static char *parse_received(struct query *ctl, char *bufp) char *sp, *tp; /* char after "for" could be space or a continuation newline */ - for (sp = ok + 4; isspace(*sp); sp++) + for (sp = ok + 4; isspace((unsigned char)*sp); sp++) continue; tp = rbuf; RBUF_WRITE(':'); /* Here is the hack. This is to be friends */ @@ -295,9 +295,9 @@ static char *parse_received(struct query *ctl, char *bufp) while (*sp && *sp++ != ':') continue; while (*sp - && (want_gt ? (*sp != '>') : !isspace(*sp)) + && (want_gt ? (*sp != '>') : !isspace((unsigned char)*sp)) && *sp != ';') - if (!isspace(*sp)) + if (!isspace((unsigned char)*sp)) { RBUF_WRITE(*sp); sp++; @@ -543,7 +543,7 @@ int readheaders(int sock, * line before the body! Without this check fetchmail segfaults. * With it, we treat such messages as spam and refuse them. */ - if (!refuse_mail && !isspace(line[0]) && !strchr(line, ':')) + if (!refuse_mail && !isspace((unsigned char)line[0]) && !strchr(line, ':')) { if (linelen != strlen (line)) has_nuls = TRUE; @@ -696,7 +696,7 @@ int readheaders(int sock, else cp = NULL; if (cp) { - while (*cp && isspace(*cp)) cp++; + while (*cp && isspace((unsigned char)*cp)) cp++; if (!*cp || ctl->dropstatus) { free(line); |