summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-02-01 15:08:42 +0000
committerDamien George <damien.p.george@gmail.com>2016-02-01 15:08:42 +0000
commit9e677114e4aba8fdb417350a87ce1af33cef127f (patch)
tree8b0bb9772830414b7f76893dfe8147220d25db28 /py
parent331a48195d325b9557175056e2c3650ef496d862 (diff)
downloadmicropython-9e677114e4aba8fdb417350a87ce1af33cef127f.tar.gz
micropython-9e677114e4aba8fdb417350a87ce1af33cef127f.zip
py/mpprint: Fix sign extension when printf'ing %u, %x and %X.
Diffstat (limited to 'py')
-rw-r--r--py/mpprint.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/py/mpprint.c b/py/mpprint.c
index 206cf2aa5c..cb49b1227a 100644
--- a/py/mpprint.c
+++ b/py/mpprint.c
@@ -494,16 +494,16 @@ int mp_vprintf(const mp_print_t *print, const char *fmt, va_list args) {
break;
}
case 'u':
- chrs += mp_print_int(print, va_arg(args, int), 0, 10, 'a', flags, fill, width);
+ chrs += mp_print_int(print, va_arg(args, unsigned int), 0, 10, 'a', flags, fill, width);
break;
case 'd':
chrs += mp_print_int(print, va_arg(args, int), 1, 10, 'a', flags, fill, width);
break;
case 'x':
- chrs += mp_print_int(print, va_arg(args, int), 0, 16, 'a', flags, fill, width);
+ chrs += mp_print_int(print, va_arg(args, unsigned int), 0, 16, 'a', flags, fill, width);
break;
case 'X':
- chrs += mp_print_int(print, va_arg(args, int), 0, 16, 'A', flags, fill, width);
+ chrs += mp_print_int(print, va_arg(args, unsigned int), 0, 16, 'A', flags, fill, width);
break;
case 'p':
case 'P': // don't bother to handle upcase for 'P'