tiny-printf: Correct the snprintf() implementation
PATCH v2 1/1 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.
---
Changes in v2:
- Correct the 'Fixes' line
lib/tiny-printf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
lib/tiny-printf.c +3 -1
@@ -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; }
Signature · 1 line
2.8.0.rc3.226.g39d4020
PATCH v2 1/1 tiny-printf: Correct the snprintf() implementation
Quoted 7 lines · Simon Glass
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()")Signed-off-by Simon Glass <[email protected]>
Thanks,
Stefan
PATCH v2 1/1 tiny-printf: Correct the snprintf() implementation
Quoted 11 lines · Stefan Roese
Quoted 8 lines · Simon Glass
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()")Signed-off-by Simon Glass <[email protected]>Reviewed-by Stefan Roese <[email protected]>
Signature · 2 lines
Best regards, Marek Vasut
PATCH v2 1/1 tiny-printf: Correct the snprintf() implementation
In reply to Simon GlassQuoted 9 lines · Simon Glass
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 <[email protected]>Acked-by Marek Vasut <[email protected]>Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160609/80f56a2f/attachment.sig>