do flush properly
This commit is contained in:
parent
e5f0d957f2
commit
62780722f5
2 changed files with 7 additions and 1 deletions
|
|
@ -31,7 +31,11 @@ Bfmtinit(Fmt *f, Biobuf *b)
|
||||||
int
|
int
|
||||||
Bfmtflush(Fmt *f)
|
Bfmtflush(Fmt *f)
|
||||||
{
|
{
|
||||||
if(_Bfmtflush(f) <= 0)
|
Biobuf *b;
|
||||||
|
|
||||||
|
b = f->farg;
|
||||||
|
if(f->to == nil)
|
||||||
return -1;
|
return -1;
|
||||||
|
b->ocount = (char*)f->to - (char*)f->stop;
|
||||||
return f->nfmt;
|
return f->nfmt;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,5 +14,7 @@ Bprint(Biobuf *bp, char *fmt, ...)
|
||||||
f.args = args;
|
f.args = args;
|
||||||
n = dofmt(&f, fmt);
|
n = dofmt(&f, fmt);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
if(n > 0 && Bfmtflush(&f) < 0)
|
||||||
|
return -1;
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue