X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fimap%2Fimap_fetch.c;h=2aedb211787c5a91308aec271c97a49094fa9e68;hb=64c5deb3abadc256b390413fe34a1cd9d5b4046d;hp=75a05dbb41ab571672a005cd720dedbc43367d15;hpb=0d3e9dd6c1fdaf2ada4e76fe7491304d7877c0b3;p=citadel.git diff --git a/citadel/modules/imap/imap_fetch.c b/citadel/modules/imap/imap_fetch.c index 75a05dbb4..2aedb2117 100644 --- a/citadel/modules/imap/imap_fetch.c +++ b/citadel/modules/imap/imap_fetch.c @@ -530,7 +530,8 @@ void imap_strip_headers(char *section) { ptr = CC->redirect_buffer; ok = 0; - while ( (done_headers == 0) && (ptr = memreadline(ptr, buf, sizeof buf), *ptr != 0) ) { + do { + ptr = memreadline(ptr, buf, sizeof buf); if (!isspace(buf[0])) { ok = 0; if (doing_headers == 0) ok = 1; @@ -556,7 +557,8 @@ void imap_strip_headers(char *section) { if (IsEmptyStr(buf)) done_headers = 1; if (buf[0]=='\r') done_headers = 1; if (buf[0]=='\n') done_headers = 1; - } + if (*ptr == 0) done_headers = 1; + } while (!done_headers); strcat(boiled_headers, "\r\n"); @@ -924,12 +926,13 @@ void imap_fetch_bodystructure (long msgnum, char *item, CC->redirect_alloc = 0; ptr = rfc822; - while (ptr = memreadline(ptr, buf, sizeof buf), *ptr != 0) { + do { + ptr = memreadline(ptr, buf, sizeof buf); ++lines; if ((IsEmptyStr(buf)) && (rfc822_body == NULL)) { rfc822_body = ptr; } - } + } while (*ptr != 0); rfc822_headers_len = rfc822_body - rfc822; rfc822_body_len = rfc822_len - rfc822_headers_len;