From 1ff3f84068124ee58e1a0799f39f915745edc296 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Sun, 27 Dec 2009 03:41:55 +0100 Subject: [PATCH] fix for unused results in mboxscan.c --- src/mboxscan.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/mboxscan.c b/src/mboxscan.c index f106f0aa..7715d1ba 100644 --- a/src/mboxscan.c +++ b/src/mboxscan.c @@ -220,7 +220,8 @@ static void mbox_scan(char *args, char *output, size_t max_len) /* skip until \n */ while (strchr(buf, '\n') == NULL && !feof(fp)) { - fgets(buf, text_buffer_size, fp); + if (!fgets(buf, text_buffer_size, fp)) + break; } flag = 0; /* in the headers now */ @@ -236,7 +237,8 @@ static void mbox_scan(char *args, char *output, size_t max_len) /* then search for new mail ("From ") */ while (strchr(buf, '\n') == NULL && !feof(fp)) { - fgets(buf, text_buffer_size, fp); + if (!fgets(buf, text_buffer_size, fp)) + break; } flag = 1; /* in the body now */ continue; @@ -253,7 +255,8 @@ static void mbox_scan(char *args, char *output, size_t max_len) curr = curr->previous; /* Skip until \n */ while (strchr(buf, '\n') == NULL && !feof(fp)) { - fgets(buf, text_buffer_size, fp); + if (!fgets(buf, text_buffer_size, fp)) + break; } continue; } @@ -276,7 +279,8 @@ static void mbox_scan(char *args, char *output, size_t max_len) curr->from[i] = '\0'; /* skip until \n */ while (strchr(buf, '\n') == NULL && !feof(fp)) { - fgets(buf, text_buffer_size, fp); + if (!fgets(buf, text_buffer_size, fp)) + break; } break; } @@ -295,7 +299,8 @@ static void mbox_scan(char *args, char *output, size_t max_len) curr->from[i] = '\0'; /* skip until \n */ while (strchr(buf, '\n') == NULL && !feof(fp)) { - fgets(buf, text_buffer_size, fp); + if (!fgets(buf, text_buffer_size, fp)) + break; } break; } @@ -325,7 +330,8 @@ static void mbox_scan(char *args, char *output, size_t max_len) /* skip until \n */ while (strchr(buf, '\n') == NULL && !feof(fp)) { - fgets(buf, text_buffer_size, fp); + if (!fgets(buf, text_buffer_size, fp)) + break; } break; }