summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2017-01-02 11:48:29 +0000
committerJagan Teki <jagan@openedev.com>2017-01-04 16:37:41 +0100
commit1c853629d936f88d7d41bdd01a3bd8c55391e754 (patch)
tree9806e5a9a8b7f8cb170d3fa770e73cd4c81302cd /lib
parenta28e1d98310e62dc88947b91d17105b58de01889 (diff)
downloadu-boot-1c853629d936f88d7d41bdd01a3bd8c55391e754.tar.gz
u-boot-1c853629d936f88d7d41bdd01a3bd8c55391e754.tar.bz2
u-boot-1c853629d936f88d7d41bdd01a3bd8c55391e754.zip
SPL: tiny-printf: ignore "-" modifier
tiny-printf does not know about the "-" modifier, which aligns numbers. This is used by some SPL code, but as it's purely cosmetical, we just ignore this modifier here to avoid changing correct printf strings. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagan Teki <jagan@openedev.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/tiny-printf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/tiny-printf.c b/lib/tiny-printf.c
index 0b8512faf5..dfa843240f 100644
--- a/lib/tiny-printf.c
+++ b/lib/tiny-printf.c
@@ -69,6 +69,9 @@ int _vprintf(struct printf_info *info, const char *fmt, va_list va)
bool islong = false;
ch = *(fmt++);
+ if (ch == '-')
+ ch = *(fmt++);
+
if (ch == '0') {
ch = *(fmt++);
lz = 1;