mirror of
https://github.com/Fishwaldo/opensbi.git
synced 2025-03-15 19:31:32 +00:00
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 <wxjstz@126.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
parent
6053917626
commit
35ef182690
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue