[U-Boot] [PATCH v3 05/26] SPL: tiny-printf: ignore "-" modifier

Andre Przywara andre.przywara at arm.com
Mon Dec 19 02:49:55 CET 2016


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 at arm.com>
---
 lib/tiny-printf.c | 3 +++
 1 file changed, 3 insertions(+)

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;
-- 
2.8.2



More information about the U-Boot mailing list