xref: /plan9/sys/src/libc/fmt/fmtvprint.c (revision 53ff6c4dddeb19bd84c918cdd2542d7c51263329)
1 #include <u.h>
2 #include <libc.h>
3 #include "fmtdef.h"
4 
5 
6 /*
7  * format a string into the output buffer
8  * designed for formats which themselves call fmt
9  */
10 int
fmtvprint(Fmt * f,char * fmt,va_list args)11 fmtvprint(Fmt *f, char *fmt, va_list args)
12 {
13 	va_list va;
14 	int n;
15 
16 	va = f->args;
17 	f->args = args;
18 	n = dofmt(f, fmt);
19 	f->args = va;
20 	if(n >= 0)
21 		return 0;
22 	return n;
23 }
24 
25