From 127b12dcf6bd1a150fa2ebdec3161fcddab9ada6 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 18 Mar 2011 09:52:07 +0100 Subject: [PATCH] tailf: support --lines 0 Signed-off-by: Karel Zak --- text-utils/tailf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text-utils/tailf.c b/text-utils/tailf.c index 0b99a1ae69..fbe81c89de 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) { -- 2.47.2