aboutsummaryrefslogtreecommitdiff
path: root/builtin-mailsplit.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-mailsplit.c')
-rw-r--r--builtin-mailsplit.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/builtin-mailsplit.c b/builtin-mailsplit.c
index e4d977baf..ae2b4cb21 100644
--- a/builtin-mailsplit.c
+++ b/builtin-mailsplit.c
@@ -52,13 +52,12 @@ int read_line_with_nul(char *buf, int size, FILE *in)
for (;;) {
c = getc(in);
+ if (c == EOF)
+ break;
buf[len++] = c;
- if (c == EOF || c == '\n' || len + 1 >= size)
+ if (c == '\n' || len + 1 >= size)
break;
}
-
- if (c == EOF)
- len--;
buf[len] = '\0';
return len;