mirror of
https://github.com/Fishwaldo/opensbi.git
synced 2025-03-15 19:31:32 +00:00
lib: sbi: print add 'o' type
Add o type for print to print octal numbers Signed-off-by: Xiang W <wxjstz@126.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
parent
05cbb6e908
commit
fe0828142f
1 changed files with 4 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue