summaryrefslogtreecommitdiff
path: root/lib/tiny-printf.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tiny-printf.c')
-rw-r--r--lib/tiny-printf.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/tiny-printf.c b/lib/tiny-printf.c
index 4f7fc239ae..1138c7012a 100644
--- a/lib/tiny-printf.c
+++ b/lib/tiny-printf.c
@@ -377,6 +377,22 @@ int sprintf(char *buf, const char *fmt, ...)
return ret;
}
+#if CONFIG_IS_ENABLED(LOG)
+/* Note that size is ignored */
+int vsnprintf(char *buf, size_t size, const char *fmt, va_list va)
+{
+ struct printf_info info;
+ int ret;
+
+ info.outstr = buf;
+ info.putc = putc_outstr;
+ ret = _vprintf(&info, fmt, va);
+ *info.outstr = '\0';
+
+ return ret;
+}
+#endif
+
/* Note that size is ignored */
int snprintf(char *buf, size_t size, const char *fmt, ...)
{