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:
+1
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user