diff options
author | Matt Kraai <kraai@debian.org> | 2001-11-20 18:49:50 +0300 |
---|---|---|
committer | Matt Kraai <kraai@debian.org> | 2001-11-20 18:49:50 +0300 |
commit | 355a61b56ff991d6e7a6febe66623443e0213d8a (patch) | |
tree | 1af63f72e84351c7b197435ea0f9173311a7f82c /libbb | |
parent | 66c22051f9693e7340f0f0eb706ed8cdd002c41b (diff) |
Treat NUL as the end-of-line.
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/get_line_from_file.c | 2 |
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; } |