xref: /plan9-contrib/sys/src/ape/lib/ap/stdio/vsprintf.c (revision 781103c4074deb8af160e8a0da2742ba6b29dc2b)
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 	FILE *f=_IO_sopenw();
8 	if(f==NULL)
9 		return 0;
10 	setvbuf(f, buf, _IOFBF, 100000);
11 	n=vfprintf(f, fmt, args);
12 	_IO_sclose(f);
13 	return n;
14 }
15