diff options
| author | Xiang W <[email protected]> | 2023-07-10 00:02:26 +0800 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2023-07-12 09:59:22 +0530 |
| commit | fe0828142fa34a95b6933dd94e68ed528d4c5778 (patch) | |
| tree | 7c480551b6350b5d5b0c7f29ea47c8064ee47ce0 | |
| parent | 05cbb6e908a469f152d0253cfdf7c1aa2bda820d (diff) | |
lib: sbi: print add 'o' type
Add o type for print to print octal numbers
Signed-off-by: Xiang W <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
| -rw-r--r-- | lib/sbi/sbi_console.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/sbi/sbi_console.c b/lib/sbi/sbi_console.c index 51380cff..10b27c62 100644 --- a/lib/sbi/sbi_console.c +++ b/lib/sbi/sbi_console.c @@ -327,7 +327,8 @@ static int print(char **out, u32 *out_len, const char *format, va_list args) width, flags, *format); continue; } - if ((*format == 'u') || (*format == 'x') || (*format == 'X')) { + if ((*format == 'u') || (*format == 'o') + || (*format == 'x') || (*format == 'X')) { pc += printi(out, out_len, va_arg(args, unsigned int), width, flags, *format); continue; @@ -341,7 +342,7 @@ static int print(char **out, u32 *out_len, const char *format, va_list args) type = 'i'; if (format[1] == 'l') { ++format; - if ((format[1] == 'u') + if ((format[1] == 'u') || (format[1] == 'o') || (format[1] == 'd') || (format[1] == 'i') || (format[1] == 'x') || (format[1] == 'X')) { ++format; @@ -351,7 +352,7 @@ static int print(char **out, u32 *out_len, const char *format, va_list args) width, flags, type); continue; } - if ((format[1] == 'u') + if ((format[1] == 'u') || (format[1] == 'o') || (format[1] == 'd') || (format[1] == 'i') || (format[1] == 'x') || (format[1] == 'X')) { ++format; |
