diff options
author | Karel Zak | 2011-03-18 09:52:07 +0100 |
---|---|---|
committer | Karel Zak | 2011-03-18 09:52:07 +0100 |
commit | 127b12dcf6bd1a150fa2ebdec3161fcddab9ada6 (patch) | |
tree | c9202f06697f65a8a2ca00d759098d229bc28e4f /text-utils | |
parent | libmount: rename mount option "quiet" to "silent" (diff) | |
download | kernel-qcow2-util-linux-127b12dcf6bd1a150fa2ebdec3161fcddab9ada6.tar.gz kernel-qcow2-util-linux-127b12dcf6bd1a150fa2ebdec3161fcddab9ada6.tar.xz kernel-qcow2-util-linux-127b12dcf6bd1a150fa2ebdec3161fcddab9ada6.zip |
tailf: support --lines 0
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'text-utils')
-rw-r--r-- | text-utils/tailf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/text-utils/tailf.c b/text-utils/tailf.c index 0b99a1ae6..fbe81c89d 100644 --- a/text-utils/tailf.c +++ b/text-utils/tailf.c @@ -60,7 +60,7 @@ tailf(const char *filename, int lines) if (!(str = fopen(filename, "r"))) err(EXIT_FAILURE, _("cannot open \"%s\" for read"), filename); - buf = xmalloc(lines * BUFSIZ); + buf = xmalloc((lines ? lines : 1) * BUFSIZ); p = buf; while (fgets(p, BUFSIZ, str)) { if (++tail >= lines) { |