diff options
| author | Tim J. Robbins <tjr@FreeBSD.org> | 2002-10-01 13:41:13 +0000 |
|---|---|---|
| committer | Tim J. Robbins <tjr@FreeBSD.org> | 2002-10-01 13:41:13 +0000 |
| commit | 658a755b6a6b185473fdf7ce0cbb8eb017804fba (patch) | |
| tree | 4e0fc855a7c106d113294e2769fd8da55d51c1e9 /bin/sh | |
| parent | 7206028152b8c96c70e558afad497b6c42d6d505 (diff) | |
Notes
Diffstat (limited to 'bin/sh')
| -rw-r--r-- | bin/sh/output.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/sh/output.c b/bin/sh/output.c index 6276417e07d2..b850d8005a4e 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 |
