diff options
author | Tom Rini <trini@konsulko.com> | 2015-12-16 14:50:03 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2015-12-16 14:50:03 -0500 |
commit | 35065cdd94a41dee4882b921f9763742e44d1c58 (patch) | |
tree | aaa4a4ecdad344cb50427eb79f3a91c3311b2d3f /lib/tiny-printf.c | |
parent | 52bc7c7e2b31d6ba8d394f3d22b551abfa365363 (diff) | |
parent | 47b4c228b5ae72598dc38ca2764c11ea1c6693cc (diff) |
Merge git://git.denx.de/u-boot-rockchip
Diffstat (limited to 'lib/tiny-printf.c')
-rw-r--r-- | lib/tiny-printf.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/tiny-printf.c b/lib/tiny-printf.c index 6766a8f1c8..403b134cd1 100644 --- a/lib/tiny-printf.c +++ b/lib/tiny-printf.c @@ -40,17 +40,14 @@ static void div_out(unsigned int *num, unsigned int div) out_dgt(dgt); } -int printf(const char *fmt, ...) +int vprintf(const char *fmt, va_list va) { - va_list va; char ch; char *p; unsigned int num; char buf[12]; unsigned int div; - va_start(va, fmt); - while ((ch = *(fmt++))) { if (ch != '%') { putc(ch); @@ -117,6 +114,17 @@ int printf(const char *fmt, ...) } abort: - va_end(va); return 0; } + +int printf(const char *fmt, ...) +{ + va_list va; + int ret; + + va_start(va, fmt); + ret = vprintf(fmt, va); + va_end(va); + + return ret; +} |