소스 검색

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>
Andre Przywara 8 년 전
부모
커밋
1c853629d9
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      lib/tiny-printf.c

+ 3 - 0
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;