summaryrefslogtreecommitdiff
path: root/lib/snprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/snprintf.c')
-rw-r--r--lib/snprintf.c25
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;
+}