summaryrefslogtreecommitdiff
path: root/lib/tiny-printf.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-11-01 09:23:21 -0400
committerTom Rini <trini@konsulko.com>2019-11-01 09:23:21 -0400
commit82679624f9aa6d1be733c46f3555d5166b6f5b72 (patch)
tree8a99cf79bc520b833e155094ef134c0526b1f005 /lib/tiny-printf.c
parent412326d1bc2d346d7b4faad6fa547eaf065681a2 (diff)
parent5d80a1a93d42c8325d65516cc654ff6a9ceec58a (diff)
Merge branch '2019-10-30-master-imports'
- Migrate test.py to use python3 and current pytest. - NVMe bugfixes - Assorted other fixes - Android AVB updates.
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 ebef92fc9f6..62e63819617 100644
--- a/lib/tiny-printf.c
+++ b/lib/tiny-printf.c
@@ -366,6 +366,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, ...)
{