]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
SPL: tiny-printf: ignore "-" modifier
authorAndre Przywara <andre.przywara@arm.com>
Mon, 2 Jan 2017 11:48:29 +0000 (11:48 +0000)
committerJagan Teki <jagan@openedev.com>
Wed, 4 Jan 2017 15:37:41 +0000 (16:37 +0100)
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>
lib/tiny-printf.c

index 0b8512faf5b95c07477f146b0d0c8fe700344f57..dfa843240fc89484bbe82e939eb4d8d12fc3a315 100644 (file)
@@ -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;