From 658a755b6a6b185473fdf7ce0cbb8eb017804fba Mon Sep 17 00:00:00 2001 From: "Tim J. Robbins" Date: Tue, 1 Oct 2002 13:41:13 +0000 Subject: [PATCH] Back out experimental changes to fmtstr() that I didn't mean to include in the previous commit. --- bin/sh/output.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/sh/output.c b/bin/sh/output.c index 6276417e07d..b850d8005a4 100644 --- a/bin/sh/output.c +++ b/bin/sh/output.c @@ -263,10 +263,18 @@ void fmtstr(char *outbuf, int length, const char *fmt, ...) { va_list ap; + struct output strout; + strout.nextc = outbuf; + strout.nleft = length; + strout.fd = BLOCK_OUT; + strout.flags = 0; va_start(ap, fmt); - snprintf(outbuf, length, fmt, ap); + doformat(&strout, fmt, ap); va_end(ap); + outc('\0', &strout); + if (strout.flags & OUTPUT_ERR) + outbuf[length - 1] = '\0'; } static int