diff toys/count.c @ 550:b2194045c40e

Remove "feature test macros", replace non-portable fdprintf() with standard fprintf().
author Rob Landley <rob@landley.net>
date Mon, 19 Mar 2012 19:19:21 -0500
parents 5ab9d0e5e0f8
children
line wrap: on
line diff
--- a/toys/count.c	Fri Mar 16 06:42:08 2012 -0500
+++ b/toys/count.c	Mon Mar 19 19:19:21 2012 -0500
@@ -23,13 +23,14 @@
 {
 	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);
 }