aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbb/get_line_from_file.c2
1 files changed, 1 insertions, 1 deletions
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;
}