diff options
| author | Charles Forsyth <charles.forsyth@gmail.com> | 2013-06-06 20:59:23 +0000 |
|---|---|---|
| committer | Charles Forsyth <charles.forsyth@gmail.com> | 2013-06-06 20:59:23 +0000 |
| commit | 72335078034e3cd7edcb1739556b405a3e1e9bf8 (patch) | |
| tree | 9e1baa8ea80bfab1885cfcf224a62040a417fa74 /libbio/bprint.c | |
| parent | 3a0400887de9df81e4d4fb3bc3dec52af2d49f80 (diff) | |
sync with plan 9
Diffstat (limited to 'libbio/bprint.c')
| -rw-r--r-- | libbio/bprint.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/libbio/bprint.c b/libbio/bprint.c index 26870024..36890e6d 100644 --- a/libbio/bprint.c +++ b/libbio/bprint.c @@ -4,26 +4,11 @@ int Bprint(Biobuf *bp, char *fmt, ...) { - va_list ap; - char *ip, *ep, *out; + va_list arg; int n; - ep = (char*)bp->ebuf; - ip = ep + bp->ocount; - va_start(ap, fmt); - out = vseprint(ip, ep, fmt, ap); - va_end(ap); - if(out == nil || out >= ep-5) { - if(Bflush(bp) < 0) - return Beof; - ip = ep + bp->ocount; - va_start(ap, fmt); - out = vseprint(ip, ep, fmt, ap); - va_end(ap); - if(out == nil || out >= ep-5) - return Beof; - } - n = out-ip; - bp->ocount += n; + va_start(arg, fmt); + n = Bvprint(bp, fmt, arg); + va_end(arg); return n; } |
