From 42303209f44a335025b9cd1dbe5dd2f3069f2e99 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 15 Aug 2020 05:33:35 -0500 Subject: If we fflush(stdout) first we can just write to filehandle. --- lib/xwrap.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/xwrap.c b/lib/xwrap.c index 27473cf5..86905350 100644 --- a/lib/xwrap.c +++ b/lib/xwrap.c @@ -161,12 +161,8 @@ void xputsl(char *s, int len) { int out; - while (len != (out = fwrite(s, 1, len, stdout))) { - if (out<1) perror_exit("write"); - len -= out; - s += out; - } xflush(0); + xwrite(0, s, len); } // xputs with no newline -- cgit v1.2.3