lib: sbi: Add ' ' '\'' flags for print
authorXiang W <wxjstz@126.com>
Sun, 9 Jul 2023 16:02:24 +0000 (00:02 +0800)
committerAnup Patel <anup@brainfault.org>
Wed, 12 Jul 2023 04:28:00 +0000 (09:58 +0530)
The space flag is used to add a space before positive numbers, and
apostrophe is used to print the thousand separator. Add code to
ignore these two flags

Signed-off-by: Xiang W <wxjstz@126.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
lib/sbi/sbi_console.c

index 20fe65a3030464367ca5f77d08dff17614338005..4229e7e3be3a0bbca967c2de07a88945945e3054 100644 (file)
@@ -288,6 +288,10 @@ static int print(char **out, u32 *out_len, const char *format, va_list args)
                                case '0':
                                        flags |= PAD_ZERO;
                                        break;
+                               case ' ':
+                               case '\'':
+                                       /* Ignored flags, do nothing */
+                                       break;
                                default:
                                        flags_done = true;
                                        break;