pfenv_printf: Properly implement %p format specifier.

Previously, it truncated pointer value to 32 bits on 64-bit systems.
This commit is contained in:
Paul Sokolovsky 2014-11-26 21:17:16 +02:00 committed by Damien George
parent 1eca32836d
commit df732bb01b

View file

@ -146,13 +146,15 @@ int pfenv_vprintf(const pfenv_t *pfenv, const char *fmt, va_list args) {
chrs += pfenv_print_int(pfenv, va_arg(args, int), 1, 10, 'a', flags, fill, width);
break;
case 'x':
case 'p': // ?
chrs += pfenv_print_int(pfenv, va_arg(args, int), 0, 16, 'a', flags, fill, width);
break;
case 'X':
case 'P': // ?
chrs += pfenv_print_int(pfenv, va_arg(args, int), 0, 16, 'A', flags, fill, width);
break;
case 'p':
case 'P': // don't bother to handle upcase for 'P'
chrs += pfenv_print_int(pfenv, va_arg(args, mp_uint_t), 0, 16, 'a', flags, fill, width);
break;
#if MICROPY_PY_BUILTINS_FLOAT
case 'e':
case 'E':