summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tee.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tee.c b/src/tee.c
index 162455c53..4e46aabb5 100644
--- a/src/tee.c
+++ b/src/tee.c
@@ -190,7 +190,7 @@ tee_files (int nfiles, const char **files)
Standard output is the first one. */
for (i = 0; i <= nfiles; i++)
if (descriptors[i]
- && fwrite (buffer, 1, bytes_read, descriptors[i]) != bytes_read)
+ && fwrite (buffer, bytes_read, 1, descriptors[i]) != 1)
{
error (0, errno, "%s", files[i]);
descriptors[i] = NULL;