1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-08-17 17:08:20 +02:00

(XWRITE): Guard against calling xwrite with n_bytes == 0.

This commit is contained in:
Jim Meyering
1994-11-01 22:38:11 +00:00
parent 7a5462a0b7
commit 32340b45e7
+1 -1
View File
@@ -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)