From: Jim Meyering Date: Tue, 1 Nov 1994 22:38:11 +0000 (+0000) Subject: (XWRITE): Guard against calling xwrite with n_bytes == 0. X-Git-Tag: textutils-1_12_1~483 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=32340b45e70eeff17f153615e8f3e43712cb7ba9;p=thirdparty%2Fcoreutils.git (XWRITE): Guard against calling xwrite with n_bytes == 0. --- diff --git a/src/tail.c b/src/tail.c index 138f93a0c4..7fccd9e3a0 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)