]> git.lizzy.rs Git - plan9front.git/blob - sys/src/libstdio/vsnprintf.c
dpost prologue: update /radicalex to fix square displacement (thanks umbraticus and...
[plan9front.git] / sys / src / libstdio / vsnprintf.c
1 /*
2  * pANS stdio -- vsnprintf
3  */
4 #include "iolib.h"
5 int vsnprintf(char *buf, int nbuf, 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, nbuf);
11         n=vfprintf(f, fmt, args);
12         sclose(f);
13         return n;
14 }