mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-07-24 10:25:42 -04:00
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.
25 lines
352 B
C
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;
|
|
}
|
|
|