From: Simon Glass Date: Sun, 30 Jul 2023 17:15:13 +0000 (-0600) Subject: lib: Suppress E when writing error-string output X-Git-Tag: baikal/mips/sdk6.2~4^2~3^2~43^2~34 X-Git-Url: https://git.baikalelectronics.ru/?a=commitdiff_plain;h=b9549803140c7c3c3c64cc4848808a2fd9d6340a;p=uboot.git lib: Suppress E when writing error-string output When CONFIG_ERRNO_STR is not enabled this shows a spurious 'E' from the format string. Fix this. Fixes: ded298a7e13 ("lib: Support printing an error string") Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- diff --git a/lib/vsprintf.c b/lib/vsprintf.c index e87503e41a..e14c6ca9f9 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -680,8 +680,10 @@ repeat: break; case 'd': - if (fmt[1] == 'E') + if (fmt[1] == 'E') { flags |= ERRSTR; + fmt++; + } /* fallthrough */ case 'i': flags |= SIGN; @@ -725,7 +727,6 @@ repeat: ADDCH(str, ' '); for (p = errno_str(num); *p; p++) ADDCH(str, *p); - fmt++; } }