mirror of
https://github.com/git/git.git
synced 2024-11-24 10:26:17 +08:00
mailsplit: minor clean-up in read_line_with_nul()
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
9aa23094c2
commit
edc5594153
@ -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…
Reference in New Issue
Block a user