Browse Source

mailsplit: minor clean-up in read_line_with_nul()

Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Junio C Hamano 17 years ago
parent
commit
edc5594153
  1. 7
      builtin-mailsplit.c

7
builtin-mailsplit.c

@ -52,13 +52,12 @@ int read_line_with_nul(char *buf, int size, FILE *in) @@ -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;

Loading…
Cancel
Save