Make %p consistent with glibc and musl

See #61
This commit is contained in:
Justine Tunney 2021-03-06 14:26:36 -08:00
parent 937d921018
commit c3ed8d6c7f
11 changed files with 141 additions and 73 deletions

View file

@ -259,10 +259,9 @@ hidden int __fmt(void *fn, void *arg, const char *format, va_list va) {
alphabet = "0123456789abcdef";
switch ((d = *format++)) {
case 'p':
flags |= FLAGS_ZEROPAD;
width = POINTER_XDIGITS;
flags |= FLAGS_HASH;
log2base = 4;
signbit = 47;
signbit = 63;
goto FormatNumber;
case 'X':
alphabet = "0123456789ABCDEF";