aboutsummaryrefslogtreecommitdiff
path: root/toys/count.c
diff options
context:
space:
mode:
Diffstat (limited to 'toys/count.c')
-rw-r--r--toys/count.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/toys/count.c b/toys/count.c
index acc0c69f..0ec3919d 100644
--- a/toys/count.c
+++ b/toys/count.c
@@ -23,13 +23,14 @@ void count_main(void)
{
uint64_t size = 0;
int len;
+ char buf[32];
for (;;) {
len = xread(0, toybuf, sizeof(toybuf));
if (!len) break;
size += len;
xwrite(1, toybuf, len);
- fdprintf(2, "%"PRIu64" bytes\r", size);
+ xwrite(2, buf, sprintf(buf, "%"PRIu64" bytes\r", size));
}
- fdprintf(2,"\n");
+ xwrite(2, "\n", 1);
}