Import sources from 2011-03-30 iso image
This commit is contained in:
commit
e5888a1ffd
7810 changed files with 2489717 additions and 0 deletions
17
sys/src/libstdio/snprintf.c
Executable file
17
sys/src/libstdio/snprintf.c
Executable file
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* pANS stdio -- sprintf
|
||||
*/
|
||||
#include "iolib.h"
|
||||
int snprintf(char *buf, int nbuf, const char *fmt, ...){
|
||||
int n;
|
||||
va_list args;
|
||||
FILE *f=sopenw();
|
||||
if(f==NULL)
|
||||
return 0;
|
||||
setvbuf(f, buf, _IOFBF, nbuf);
|
||||
va_start(args, fmt);
|
||||
n=vfprintf(f, fmt, args);
|
||||
va_end(args);
|
||||
sclose(f);
|
||||
return n;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue