summaryrefslogtreecommitdiff
path: root/sys/src/ape/lib/ap/stdio/vsprintf.c
blob: 7b3fe6ec411b559c6457d3702ca749cc4393f4a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*
 * pANS stdio -- vsprintf
 */
#include "iolib.h"
int vsprintf(char *buf, const char *fmt, va_list args){
	int n;
	FILE *f=_IO_sopenw();
	if(f==NULL)
		return 0;
	setvbuf(f, buf, _IOFBF, 100000);
	n=vfprintf(f, fmt, args);
	_IO_sclose(f);
	return n;
}