diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-10-05 19:17:16 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-10-05 19:17:16 +0000 |
commit | 226002ea74a5285bb338b17419c13f43a1ff5a47 (patch) | |
tree | 97e250104b00a62727220a64f8d223f6e6a1132d /coreutils | |
parent | d21f596ddb294bdb65623ba1d0e49b17d0829229 (diff) | |
download | busybox-w32-226002ea74a5285bb338b17419c13f43a1ff5a47.tar.gz busybox-w32-226002ea74a5285bb338b17419c13f43a1ff5a47.tar.bz2 busybox-w32-226002ea74a5285bb338b17419c13f43a1ff5a47.zip |
tail: sizeof(buf) is sizeof(char*)! must be BUFSIZ
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/tail.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/coreutils/tail.c b/coreutils/tail.c index 8a112346d..53dbf33ac 100644 --- a/coreutils/tail.c +++ b/coreutils/tail.c | |||
@@ -57,7 +57,7 @@ static ssize_t tail_read(int fd, char *buf, size_t count) | |||
57 | if (sbuf.st_size < current) | 57 | if (sbuf.st_size < current) |
58 | lseek(fd, 0, SEEK_SET); | 58 | lseek(fd, 0, SEEK_SET); |
59 | 59 | ||
60 | r = safe_read(fd, buf, count); | 60 | r = full_read(fd, buf, count); |
61 | if (r < 0) { | 61 | if (r < 0) { |
62 | bb_perror_msg(bb_msg_read_error); | 62 | bb_perror_msg(bb_msg_read_error); |
63 | G.status = EXIT_FAILURE; | 63 | G.status = EXIT_FAILURE; |
@@ -271,7 +271,7 @@ int tail_main(int argc, char **argv) | |||
271 | if (nfiles > header_threshhold) { | 271 | if (nfiles > header_threshhold) { |
272 | fmt = header_fmt; | 272 | fmt = header_fmt; |
273 | } | 273 | } |
274 | while ((nread = tail_read(fds[i], buf, sizeof(buf))) > 0) { | 274 | while ((nread = tail_read(fds[i], buf, BUFSIZ)) > 0) { |
275 | if (fmt) { | 275 | if (fmt) { |
276 | tail_xprint_header(fmt, argv[i]); | 276 | tail_xprint_header(fmt, argv[i]); |
277 | fmt = NULL; | 277 | fmt = NULL; |