diff options
author | Anas Nashif <anas.nashif@intel.com> | 2012-05-15 22:27:48 +0100 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2012-05-15 22:27:48 +0100 |
commit | b9fad1ab2ad3bd87bff05c4688c978d582ada438 (patch) | |
tree | 4a373f8dd867d20e67510de7cfe447a4b58c1a70 /lib/snprintf.c | |
parent | 65c26d26fb72cec0d43d199c72ed27513d17f4c9 (diff) | |
download | nasm-b9fad1ab2ad3bd87bff05c4688c978d582ada438.tar.gz nasm-b9fad1ab2ad3bd87bff05c4688c978d582ada438.tar.bz2 nasm-b9fad1ab2ad3bd87bff05c4688c978d582ada438.zip |
Upstream version 2.08rc7
Diffstat (limited to 'lib/snprintf.c')
-rw-r--r-- | lib/snprintf.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/snprintf.c b/lib/snprintf.c new file mode 100644 index 0000000..01734dc --- /dev/null +++ b/lib/snprintf.c @@ -0,0 +1,25 @@ +/* + * snprintf() + * + * Implement snprintf() in terms of vsnprintf() + */ + +#include "compiler.h" + +#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; +} |