提交 3191d840 编写于 作者: S Simon Glass 提交者: Tom Rini

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: abeb272d ("tiny-printf: Support snprintf()")
Reviewed-by: NStefan Roese <sr@denx.de>
Acked-by: NMarek Vasut <marex@denx.de>
Signed-off-by: NSimon Glass <sjg@chromium.org>
上级 9c2f9b2d
......@@ -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;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册