Skip to content

Commit

Permalink
mailsplit: minor clean-up in read_line_with_nul()
Browse files Browse the repository at this point in the history
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed May 25, 2008
1 parent 9aa2309 commit edc5594
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions builtin-mailsplit.c
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit edc5594

Please sign in to comment.