Treat NUL as the end-of-line.

This commit is contained in:
Matt Kraai 2001-11-20 15:49:50 +00:00
parent 66c22051f9
commit 355a61b56f

View File

@ -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;
}