use fmtprint to avoid va_copy
This commit is contained in:
parent
ddb664da1b
commit
65cd9e4d85
@ -10,11 +10,7 @@ Bprint(Biobuf *bp, char *fmt, ...)
|
|||||||
|
|
||||||
if(Bfmtinit(&f, bp) < 0)
|
if(Bfmtinit(&f, bp) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
va_start(args, fmt);
|
n = fmtprint(&f, fmt, args);
|
||||||
va_copy(f.args, args);
|
|
||||||
n = dofmt(&f, fmt);
|
|
||||||
va_end(args);
|
|
||||||
va_end(f.args);
|
|
||||||
if(n > 0 && Bfmtflush(&f) < 0)
|
if(n > 0 && Bfmtflush(&f) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
return n;
|
return n;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user