From 355a61b56ff991d6e7a6febe66623443e0213d8a Mon Sep 17 00:00:00 2001 From: Matt Kraai Date: Tue, 20 Nov 2001 15:49:50 +0000 Subject: Treat NUL as the end-of-line. --- libbb/get_line_from_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libbb') diff --git a/libbb/get_line_from_file.c b/libbb/get_line_from_file.c index 9035c0412..5e7062127 100644 --- a/libbb/get_line_from_file.c +++ b/libbb/get_line_from_file.c @@ -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; } -- cgit v1.2.3