diff options
author | Matt Kraai <kraai@debian.org> | 2001-11-20 15:49:50 +0000 |
---|---|---|
committer | Matt Kraai <kraai@debian.org> | 2001-11-20 15:49:50 +0000 |
commit | 355a61b56ff991d6e7a6febe66623443e0213d8a (patch) | |
tree | 1af63f72e84351c7b197435ea0f9173311a7f82c /libbb/get_line_from_file.c | |
parent | 66c22051f9693e7340f0f0eb706ed8cdd002c41b (diff) | |
download | busybox-w32-355a61b56ff991d6e7a6febe66623443e0213d8a.tar.gz busybox-w32-355a61b56ff991d6e7a6febe66623443e0213d8a.tar.bz2 busybox-w32-355a61b56ff991d6e7a6febe66623443e0213d8a.zip |
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 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) | |||
45 | while (idx > linebufsz-2) | 45 | while (idx > linebufsz-2) |
46 | linebuf = xrealloc(linebuf, linebufsz += GROWBY); | 46 | linebuf = xrealloc(linebuf, linebufsz += GROWBY); |
47 | linebuf[idx++] = (char)ch; | 47 | linebuf[idx++] = (char)ch; |
48 | if ((char)ch == '\n') | 48 | if (ch == '\n' || ch == '\0') |
49 | break; | 49 | break; |
50 | } | 50 | } |
51 | 51 | ||