printf: %w, %b, and %p should be zero-padded but not left-padded
This fixes the goofy issue with %p coming out as " 0x123" instead of "0x00000123".
This commit is contained in:
parent
292b89b2e8
commit
81caf95136
Notes:
sideshowbarker
2024-07-19 12:09:27 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/81caf951362
1 changed files with 3 additions and 3 deletions
|
@ -331,11 +331,11 @@ template<typename PutChFunc>
|
|||
break;
|
||||
|
||||
case 'w':
|
||||
ret += print_hex(putch, bufptr, va_arg(ap, int), false, alternate_form, true, true, 4);
|
||||
ret += print_hex(putch, bufptr, va_arg(ap, int), false, alternate_form, false, true, 4);
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
ret += print_hex(putch, bufptr, va_arg(ap, int), false, alternate_form, true, true, 2);
|
||||
ret += print_hex(putch, bufptr, va_arg(ap, int), false, alternate_form, false, true, 2);
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
|
@ -350,7 +350,7 @@ template<typename PutChFunc>
|
|||
|
||||
case 'P':
|
||||
case 'p':
|
||||
ret += print_hex(putch, bufptr, va_arg(ap, u32), *p == 'P', true, true, true, 8);
|
||||
ret += print_hex(putch, bufptr, va_arg(ap, u32), *p == 'P', true, false, true, 8);
|
||||
break;
|
||||
default:
|
||||
dbg() << "printf_internal: Unimplemented format specifier " << *p;
|
||||
|
|
Loading…
Add table
Reference in a new issue