summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tail.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tail.c b/src/tail.c
index 138f93a0c..7fccd9e3a 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -62,7 +62,7 @@
{ \
assert ((fd) == 1); \
assert ((n_bytes) >= 0); \
- if (fwrite ((buffer), 1, (n_bytes), stdout) == 0) \
+ if (n_bytes > 0 && fwrite ((buffer), 1, (n_bytes), stdout) == 0) \
error (1, errno, "write error"); \
} \
while (0)