diff options
author | Matt Kraai | 2001-11-20 15:49:50 +0000 |
---|---|---|
committer | Matt Kraai | 2001-11-20 15:49:50 +0000 |
commit | 355a61b56ff991d6e7a6febe66623443e0213d8a (patch) | |
tree | 1af63f72e84351c7b197435ea0f9173311a7f82c /libbb/get_line_from_file.c | |
parent | 66c22051f9693e7340f0f0eb706ed8cdd002c41b (diff) | |
download | busybox-355a61b56ff991d6e7a6febe66623443e0213d8a.zip busybox-355a61b56ff991d6e7a6febe66623443e0213d8a.tar.gz |
Treat NUL as the end-of-line.
Diffstat (limited to 'libbb/get_line_from_file.c')
-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 9035c04..5e70621 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; } |