forked from Mirrors/opensbi
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:
@@ -288,6 +288,8 @@ static int print(char **out, u32 *out_len, const char *format, va_list args)
|
|||||||
if (!flags_done)
|
if (!flags_done)
|
||||||
++format;
|
++format;
|
||||||
}
|
}
|
||||||
|
if (flags & PAD_RIGHT)
|
||||||
|
flags &= ~PAD_ZERO;
|
||||||
/* Get width */
|
/* Get width */
|
||||||
for (; *format >= '0' && *format <= '9'; ++format) {
|
for (; *format >= '0' && *format <= '9'; ++format) {
|
||||||
width *= 10;
|
width *= 10;
|
||||||
|
Reference in New Issue
Block a user