Skip to content
Snippets Groups Projects
Commit df732bb0 authored by Paul Sokolovsky's avatar Paul Sokolovsky Committed by Damien George
Browse files

pfenv_printf: Properly implement %p format specifier.

Previously, it truncated pointer value to 32 bits on 64-bit systems.
parent 1eca3283
No related branches found
No related tags found
No related merge requests found
......@@ -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':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment