summaryrefslogtreecommitdiff
path: root/builtin-mailsplit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-05-25 08:23:55 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-05-25 20:23:57 (GMT)
commitedc5594153d7246694c1ec5bdb8ccdaa97bf7daf (patch)
tree72dc051f3dd2e8288686d4936c85a62bcf780c95 /builtin-mailsplit.c
parent9aa23094c281d1333eecb6bb1bd84b1599197d68 (diff)
downloadgit-edc5594153d7246694c1ec5bdb8ccdaa97bf7daf.zip
git-edc5594153d7246694c1ec5bdb8ccdaa97bf7daf.tar.gz
git-edc5594153d7246694c1ec5bdb8ccdaa97bf7daf.tar.bz2
mailsplit: minor clean-up in read_line_with_nul()
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 e4d977b..ae2b4cb 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;