mirror of
https://github.com/curl/curl.git
synced 2026-01-26 06:57:57 +00:00
parent
09c9afdd71
commit
3c957ad1fe
16
lib/imap.c
16
lib/imap.c
@ -437,13 +437,12 @@ static CURLcode imap_get_message(struct Curl_easy *data, struct bufref *out)
|
||||
if(len > 2) {
|
||||
/* Find the start of the message */
|
||||
len -= 2;
|
||||
for(message += 2; *message == ' ' || *message == '\t'; message++, len--)
|
||||
for(message += 2; ISBLANK(*message); message++, len--)
|
||||
;
|
||||
|
||||
/* Find the end of the message */
|
||||
while(len--)
|
||||
if(message[len] != '\r' && message[len] != '\n' && message[len] != ' ' &&
|
||||
message[len] != '\t')
|
||||
if(!ISNEWLINE(message[len]) && !ISBLANK(message[len]))
|
||||
break;
|
||||
|
||||
/* Terminate the message */
|
||||
@ -1035,20 +1034,15 @@ static CURLcode imap_state_capability_resp(struct Curl_easy *data,
|
||||
/* Loop through the data line */
|
||||
for(;;) {
|
||||
size_t wordlen;
|
||||
while(*line &&
|
||||
(*line == ' ' || *line == '\t' ||
|
||||
*line == '\r' || *line == '\n')) {
|
||||
|
||||
while(*line && (ISBLANK(*line) || ISNEWLINE(*line)))
|
||||
line++;
|
||||
}
|
||||
|
||||
if(!*line)
|
||||
break;
|
||||
|
||||
/* Extract the word */
|
||||
for(wordlen = 0; line[wordlen] && line[wordlen] != ' ' &&
|
||||
line[wordlen] != '\t' && line[wordlen] != '\r' &&
|
||||
line[wordlen] != '\n';)
|
||||
for(wordlen = 0; line[wordlen] && !ISBLANK(line[wordlen]) &&
|
||||
!ISNEWLINE(line[wordlen]);)
|
||||
wordlen++;
|
||||
|
||||
/* Does the server support the STARTTLS capability? */
|
||||
|
||||
@ -358,13 +358,12 @@ static CURLcode pop3_get_message(struct Curl_easy *data, struct bufref *out)
|
||||
if(len > 2) {
|
||||
/* Find the start of the message */
|
||||
len -= 2;
|
||||
for(message += 2; *message == ' ' || *message == '\t'; message++, len--)
|
||||
for(message += 2; ISBLANK(*message); message++, len--)
|
||||
;
|
||||
|
||||
/* Find the end of the message */
|
||||
while(len--)
|
||||
if(message[len] != '\r' && message[len] != '\n' && message[len] != ' ' &&
|
||||
message[len] != '\t')
|
||||
if(!ISBLANK(message[len]) && !ISNEWLINE(message[len]))
|
||||
break;
|
||||
|
||||
/* Terminate the message */
|
||||
|
||||
15
lib/smtp.c
15
lib/smtp.c
@ -547,13 +547,12 @@ static CURLcode smtp_get_message(struct Curl_easy *data, struct bufref *out)
|
||||
if(len > 4) {
|
||||
/* Find the start of the message */
|
||||
len -= 4;
|
||||
for(message += 4; *message == ' ' || *message == '\t'; message++, len--)
|
||||
for(message += 4; ISBLANK(*message); message++, len--)
|
||||
;
|
||||
|
||||
/* Find the end of the message */
|
||||
while(len--)
|
||||
if(message[len] != '\r' && message[len] != '\n' && message[len] != ' ' &&
|
||||
message[len] != '\t')
|
||||
if(!ISNEWLINE(message[len]) && !ISBLANK(message[len]))
|
||||
break;
|
||||
|
||||
/* Terminate the message */
|
||||
@ -1234,10 +1233,7 @@ static CURLcode smtp_state_ehlo_resp(struct Curl_easy *data,
|
||||
size_t wordlen;
|
||||
unsigned short mechbit;
|
||||
|
||||
while(len &&
|
||||
(*line == ' ' || *line == '\t' ||
|
||||
*line == '\r' || *line == '\n')) {
|
||||
|
||||
while(len && (ISBLANK(*line) || ISNEWLINE(*line))) {
|
||||
line++;
|
||||
len--;
|
||||
}
|
||||
@ -1246,9 +1242,8 @@ static CURLcode smtp_state_ehlo_resp(struct Curl_easy *data,
|
||||
break;
|
||||
|
||||
/* Extract the word */
|
||||
for(wordlen = 0; wordlen < len && line[wordlen] != ' ' &&
|
||||
line[wordlen] != '\t' && line[wordlen] != '\r' &&
|
||||
line[wordlen] != '\n';)
|
||||
for(wordlen = 0; wordlen < len && !ISBLANK(line[wordlen]) &&
|
||||
!ISNEWLINE(line[wordlen]);)
|
||||
wordlen++;
|
||||
|
||||
/* Test the word for a matching authentication mechanism */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user