diff mbox

[U-Boot,v4,05/26] SPL: tiny-printf: ignore "-" modifier

Message ID 1483357730-6800-6-git-send-email-andre.przywara@arm.com
State Accepted
Delegated to: Jagannadha Sutradharudu Teki
Headers show

Commit Message

Andre Przywara Jan. 2, 2017, 11:48 a.m. UTC
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>
---
 lib/tiny-printf.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

diff --git a/lib/tiny-printf.c b/lib/tiny-printf.c
index 0b8512f..dfa8432 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;