xref: /plan9/sys/src/libstdio/vsprintf.c (revision a84536681645e23c630ce4ef2e5c3b284d4c590b)
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=sopenw();
8 	if(f==NULL)
9 		return 0;
10 	setvbuf(f, buf, _IOFBF, 100000);
11 	n=vfprintf(f, fmt, args);
12 	sclose(f);
13 	return n;
14 }
15