0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-07-24 10:25:42 -04:00
nasm/lib/snprintf.c
H. Peter Anvin 304b605563 Add substitutes for snprintf() and vsnprintf()
To deal with fools^Wpeople trying to keep really old systems alive,
create a proper framework for substitution functions, and make it
possible to deal with the lack of snprintf/vsnprintf in particular.
2007-09-28 10:50:20 -07:00

25 lines
352 B
C

/*
* snprintf()
*
* Implement snprintf() in terms of vsnprintf()
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include "nasmlib.h"
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;
}