Subversion Repositories planix.SVN

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
/*
2
 * pANS stdio -- sprintf
3
 */
4
#include "iolib.h"
5
int snprintf(char *buf, int nbuf, const char *fmt, ...){
6
	int n;
7
	va_list args;
8
	FILE *f=sopenw();
9
	if(f==NULL)
10
		return 0;
11
	setvbuf(f, buf, _IOFBF, nbuf);
12
	va_start(args, fmt);
13
	n=vfprintf(f, fmt, args);
14
	va_end(args);
15
	sclose(f);
16
	return n;
17
}