Re: [U-Boot] [PATCH v2] tiny-printf: Correct the snprintf() implementation
On Wed, Jun 08, 2016 at 08:55:15PM -0600, Simon Glass wrote: > 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 > Acked-by: Marek Vasut > Signed-off-by: Simon Glass Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] tiny-printf: Correct the snprintf() implementation
On 06/09/2016 07:14 AM, Stefan Roese wrote: > On 09.06.2016 04:55, Simon Glass wrote: >> 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 > > Reviewed-by: Stefan Roese Acked-by: Marek Vasut -- Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] tiny-printf: Correct the snprintf() implementation
On 09.06.2016 04:55, Simon Glass wrote: 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 Reviewed-by: Stefan Roese Thanks, Stefan ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2] 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()") Signed-off-by: Simon Glass --- Changes in v2: - Correct the 'Fixes' line lib/tiny-printf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- 2.8.0.rc3.226.g39d4020 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot