summaryrefslogtreecommitdiff
path: root/src/stdio
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdio')
-rw-r--r--src/stdio/snprintf.c12
-rw-r--r--src/stdio/vsnprintf.c10
2 files changed, 21 insertions, 1 deletions
diff --git a/src/stdio/snprintf.c b/src/stdio/snprintf.c
index bc6df080..acf234b1 100644
--- a/src/stdio/snprintf.c
+++ b/src/stdio/snprintf.c
@@ -1,7 +1,19 @@
#include <stdio.h>
+#include "stdarg.h"
+#include "nonstd/io.h"
int snprintf(char * restrict s, size_t n, const char * restrict format, ...)
{
+ int ret = 0;
+ va_list ap;
+ struct io_options opt = {0};
+ opt.fnname = __func__;
+ opt.string = s;
+ opt.maxlen = n;
+ va_start(ap, format);
+ ret = __printf(&opt, format, ap);
+ va_end(ap);
+ return ret;
}
/*
diff --git a/src/stdio/vsnprintf.c b/src/stdio/vsnprintf.c
index 7c5a1e03..f54a15a1 100644
--- a/src/stdio/vsnprintf.c
+++ b/src/stdio/vsnprintf.c
@@ -1,8 +1,16 @@
#include <stdio.h>
#include "stdarg.h"
+#include "nonstd/io.h"
-int vsnprintf(char * restrict s, size_t n, va_list ap)
+int vsnprintf(char * restrict s, size_t n, const char *format, va_list arg)
{
+ int ret = 0;
+ struct io_options opt = {0};
+ opt.fnname = "fprintf";
+ opt.string = s;
+ opt.maxlen = n;
+ ret = __printf(&opt, format, arg);
+ return ret;
}
/*