aboutsummaryrefslogtreecommitdiff
path: root/src/libbio
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-04-25 21:13:58 +0000
committerrsc <devnull@localhost>2004-04-25 21:13:58 +0000
commit62780722f528fdbc19afb48128f1638e55d1568b (patch)
tree31bc08d7dae6bd79403645ba6f65a199bc6ceab2 /src/libbio
parente5f0d957f2737346033dbd3175fb6a0803d841ba (diff)
downloadplan9port-62780722f528fdbc19afb48128f1638e55d1568b.tar.gz
plan9port-62780722f528fdbc19afb48128f1638e55d1568b.tar.bz2
plan9port-62780722f528fdbc19afb48128f1638e55d1568b.zip
do flush properly
Diffstat (limited to 'src/libbio')
-rw-r--r--src/libbio/bfmt.c6
-rw-r--r--src/libbio/bprint.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/src/libbio/bfmt.c b/src/libbio/bfmt.c
index 4e0b6206..4194d05c 100644
--- a/src/libbio/bfmt.c
+++ b/src/libbio/bfmt.c
@@ -31,7 +31,11 @@ Bfmtinit(Fmt *f, Biobuf *b)
int
Bfmtflush(Fmt *f)
{
- if(_Bfmtflush(f) <= 0)
+ Biobuf *b;
+
+ b = f->farg;
+ if(f->to == nil)
return -1;
+ b->ocount = (char*)f->to - (char*)f->stop;
return f->nfmt;
}
diff --git a/src/libbio/bprint.c b/src/libbio/bprint.c
index 56d700c4..2b66605c 100644
--- a/src/libbio/bprint.c
+++ b/src/libbio/bprint.c
@@ -14,5 +14,7 @@ Bprint(Biobuf *bp, char *fmt, ...)
f.args = args;
n = dofmt(&f, fmt);
va_end(args);
+ if(n > 0 && Bfmtflush(&f) < 0)
+ return -1;
return n;
}