xref: /plan9-contrib/sys/src/ape/lib/ap/stdio/vsprintf.c (revision 219b2ee8daee37f4aad58d63f21287faa8e4ffdc)
1 /*
2  * pANS stdio -- vsprintf
3  */
4 #include "iolib.h"
5 int vsprintf(char *buf, const char *fmt, va_list args){
6 	int n;
7 	char *v;
8 	FILE *f=sopenw();
9 	if(f==NULL)
10 		return 0;
11 	setvbuf(f, buf, _IOFBF, 100000);
12 	n=vfprintf(f, fmt, args);
13 	v=sclose(f);
14 	return n;
15 }
16