projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d21f596
)
tail: sizeof(buf) is sizeof(char*)! must be BUFSIZ
author
Denis Vlasenko
<vda.linux@googlemail.com>
Fri, 5 Oct 2007 19:17:16 +0000
(19:17 -0000)
committer
Denis Vlasenko
<vda.linux@googlemail.com>
Fri, 5 Oct 2007 19:17:16 +0000
(19:17 -0000)
coreutils/tail.c
patch
|
blob
|
history
diff --git
a/coreutils/tail.c
b/coreutils/tail.c
index 8a112346d23a3abb048eebf9e4d919a0b1c25052..53dbf33ac22bbd5596b5141fffa9d2d6e42d71a4 100644
(file)
--- a/
coreutils/tail.c
+++ b/
coreutils/tail.c
@@
-57,7
+57,7
@@
static ssize_t tail_read(int fd, char *buf, size_t count)
if (sbuf.st_size < current)
lseek(fd, 0, SEEK_SET);
- r =
safe
_read(fd, buf, count);
+ r =
full
_read(fd, buf, count);
if (r < 0) {
bb_perror_msg(bb_msg_read_error);
G.status = EXIT_FAILURE;
@@
-271,7
+271,7
@@
int tail_main(int argc, char **argv)
if (nfiles > header_threshhold) {
fmt = header_fmt;
}
- while ((nread = tail_read(fds[i], buf,
sizeof(buf)
)) > 0) {
+ while ((nread = tail_read(fds[i], buf,
BUFSIZ
)) > 0) {
if (fmt) {
tail_xprint_header(fmt, argv[i]);
fmt = NULL;