summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-06-08 20:55:15 -0600
committerTom Rini <trini@konsulko.com>2016-06-09 13:52:53 -0400
commit3191d8408053674c1b9bb79a82e3973add48830c (patch)
tree4ee4b34a53ec766e18389fc6d6439ba2690f156c /lib
parent9c2f9b2da650907b928995350cc4e29480fb0f80 (diff)
downloadu-boot-imx-3191d8408053674c1b9bb79a82e3973add48830c.zip
u-boot-imx-3191d8408053674c1b9bb79a82e3973add48830c.tar.gz
u-boot-imx-3191d8408053674c1b9bb79a82e3973add48830c.tar.bz2
tiny-printf: Correct the snprintf() implementation
This current code passes the variable arguments list to sprintf(). This is not correct. Fix it by calling _vprintf() directly. This makes firefly-rk3288 boot again. Fixes: abeb272 ("tiny-printf: Support snprintf()") Reviewed-by: Stefan Roese <sr@denx.de> Acked-by: Marek Vasut <marex@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib')
-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 5ea2555..3c65fc9 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;
}