2007-09-29 01:50:20 +08:00
|
|
|
/*
|
|
|
|
* snprintf()
|
|
|
|
*
|
|
|
|
* Implement snprintf() in terms of vsnprintf()
|
|
|
|
*/
|
|
|
|
|
2007-10-03 12:53:51 +08:00
|
|
|
#include "compiler.h"
|
|
|
|
|
2007-09-29 01:50:20 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "nasmlib.h"
|
|
|
|
|
2016-03-08 18:06:39 +08:00
|
|
|
#if !defined(HAVE_SNPRINTF) && !defined(HAVE__SNPRINTF)
|
|
|
|
|
2007-09-29 01:50:20 +08:00
|
|
|
int snprintf(char *str, size_t size, const char *format, ...)
|
|
|
|
{
|
|
|
|
va_list ap;
|
|
|
|
int rv;
|
|
|
|
|
|
|
|
va_start(ap, format);
|
|
|
|
rv = vsnprintf(str, size, format, ap);
|
|
|
|
va_end(ap);
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
2016-03-08 18:06:39 +08:00
|
|
|
|
|
|
|
#endif
|