Treat NUL as the end-of-line.
This commit is contained in:
parent
66c22051f9
commit
355a61b56f
@ -45,7 +45,7 @@ extern char *get_line_from_file(FILE *file)
|
||||
while (idx > linebufsz-2)
|
||||
linebuf = xrealloc(linebuf, linebufsz += GROWBY);
|
||||
linebuf[idx++] = (char)ch;
|
||||
if ((char)ch == '\n')
|
||||
if (ch == '\n' || ch == '\0')
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user