xref: /plan9/sys/src/cmd/unix/drawterm/libc/fmtvprint.c (revision 8ccd4a6360d974db7bd7bbd4f37e7018419ea908)
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  * but ignore any width flags
10  */
11 int
12 fmtvprint(Fmt *f, char *fmt, va_list args)
13 {
14 	va_list va;
15 	int n;
16 
17 	f->flags = 0;
18 	f->width = 0;
19 	f->prec = 0;
20 	va = f->args;
21 	f->args = args;
22 	n = dofmt(f, fmt);
23 	f->flags = 0;
24 	f->width = 0;
25 	f->prec = 0;
26 	f->args = va;
27 	if(n >= 0)
28 		return 0;
29 	return n;
30 }
31 
32