summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiang W <[email protected]>2023-07-10 00:02:22 +0800
committerAnup Patel <[email protected]>2023-07-12 09:48:49 +0530
commit35ef1826906b5abfa0fc0c969ad29662fa83106d (patch)
tree4665870af4a12cfe0e6b91c8c6efdd4fd875df4d
parent60539176266fa37b4bc20054128bebec5bbe7055 (diff)
lib: sbi: print not fill '0' when left-aligned
Left alignment and padding '0' should not exist at the same time, this patch skips padding. Signed-off-by: Xiang W <[email protected]> Reviewed-by: Anup Patel <[email protected]>
-rw-r--r--lib/sbi/sbi_console.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sbi/sbi_console.c b/lib/sbi/sbi_console.c
index d87b5c20..03ee05a1 100644
--- a/lib/sbi/sbi_console.c
+++ b/lib/sbi/sbi_console.c
@@ -288,6 +288,8 @@ static int print(char **out, u32 *out_len, const char *format, va_list args)
if (!flags_done)
++format;
}
+ if (flags & PAD_RIGHT)
+ flags &= ~PAD_ZERO;
/* Get width */
for (; *format >= '0' && *format <= '9'; ++format) {
width *= 10;