summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/tiny-printf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/tiny-printf.c b/lib/tiny-printf.c
index 5ea2555280..3c65fc90bf 100644
--- a/lib/tiny-printf.c
+++ b/lib/tiny-printf.c
@@ -168,8 +168,10 @@ int snprintf(char *buf, size_t size, const char *fmt, ...)
int ret;
va_start(va, fmt);
- ret = sprintf(buf, fmt, va);
+ outstr = buf;
+ ret = _vprintf(fmt, va, putc_outstr);
va_end(va);
+ *outstr = '\0';
return ret;
}