mirror of
https://github.com/0intro/conterm
synced 2024-11-22 05:41:28 +03:00
20 lines
295 B
C
20 lines
295 B
C
#include <u.h>
|
|
#include <libc.h>
|
|
#include "fmtdef.h"
|
|
|
|
int
|
|
vfprint(int fd, char *fmt, va_list args)
|
|
{
|
|
Fmt f;
|
|
char buf[256];
|
|
int n;
|
|
|
|
fmtfdinit(&f, fd, buf, sizeof(buf));
|
|
VA_COPY(f.args,args);
|
|
n = dofmt(&f, fmt);
|
|
VA_END(f.args);
|
|
if(n > 0 && __fmtFdFlush(&f) == 0)
|
|
return -1;
|
|
return n;
|
|
}
|