py/mpprint: Make "%p" format work properly on 64-bit systems.

Before, the output was truncated to 32 bits.
pull/3122/merge
Paul Sokolovsky 2017-12-07 09:04:54 +02:00
rodzic ada1dc1c03
commit 5f8ad284f8
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -512,7 +512,8 @@ int mp_vprintf(const mp_print_t *print, const char *fmt, va_list args) {
break;
case 'p':
case 'P': // don't bother to handle upcase for 'P'
chrs += mp_print_int(print, va_arg(args, unsigned int), 0, 16, 'a', flags, fill, width);
// Use unsigned long int to work on both ILP32 and LP64 systems
chrs += mp_print_int(print, va_arg(args, unsigned long int), 0, 16, 'a', flags, fill, width);
break;
#if MICROPY_PY_BUILTINS_FLOAT
case 'e':