diff options
author | tjr <tjr@FreeBSD.org> | 2002-10-01 13:41:13 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2002-10-01 13:41:13 +0000 |
commit | d1745bcd0cc41383aea9c6dc534cc1d853c5d59a (patch) | |
tree | 4e0fc855a7c106d113294e2769fd8da55d51c1e9 /bin | |
parent | ec9540417c9773b979c0b006f762db25255128ec (diff) | |
download | FreeBSD-src-d1745bcd0cc41383aea9c6dc534cc1d853c5d59a.zip FreeBSD-src-d1745bcd0cc41383aea9c6dc534cc1d853c5d59a.tar.gz |
Back out experimental changes to fmtstr() that I didn't mean to include
in the previous commit.
Diffstat (limited to 'bin')
-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 6276417..b850d80 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 |