aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toys/cat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/cat.c b/toys/cat.c
index 118aa603..80f3ee49 100644
--- a/toys/cat.c
+++ b/toys/cat.c
@@ -28,7 +28,7 @@ static void do_cat(int fd, char *name)
len = xread(fd, toybuf, size);
if (len<0) toys.exitval = EXIT_FAILURE;
if (len<1) break;
- xwrite(1, toybuf, size);
+ xwrite(1, toybuf, len);
}
}