plan9port/src/libbio/bprint.c
rsc 984e353160 PowerPC Linux support from ericvh.
Mainly adding va_copy/va_end.
Also fix bug in sprint wrapping
around top of memory.
2004-08-22 15:39:56 +00:00

22 lines
305 B
C

#include "lib9.h"
#include <bio.h>
int
Bprint(Biobuf *bp, char *fmt, ...)
{
va_list args;
Fmt f;
int n;
if(Bfmtinit(&f, bp) < 0)
return -1;
va_start(args, fmt);
va_copy(f.args, args);
n = dofmt(&f, fmt);
va_end(args);
va_end(f.args);
if(n > 0 && Bfmtflush(&f) < 0)
return -1;
return n;
}