summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2020-11-28 17:31:13 +1100
committerDamien George <damien@micropython.org>2020-11-29 17:31:24 +1100
commitbe24e6a53faf31926a65c51426591b21f3f09c54 (patch)
tree74d8d99ce44e6726c666993d3dbe2a677d042023 /py
parent6a3d70db9642e29b017f111abaf7fb6238a9b5a6 (diff)
py/mpprint: Prevent case fall-through when assert is disabled.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py')
-rw-r--r--py/mpprint.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/py/mpprint.c b/py/mpprint.c
index c550c1d95..31cf73bb5 100644
--- a/py/mpprint.c
+++ b/py/mpprint.c
@@ -557,11 +557,9 @@ int mp_vprintf(const mp_print_t *print, const char *fmt, va_list args) {
case 'l': {
unsigned long long int arg_value = va_arg(args, unsigned long long int);
++fmt;
- if (*fmt == 'u' || *fmt == 'd') {
- chrs += mp_print_int(print, arg_value, *fmt == 'd', 10, 'a', flags, fill, width);
- break;
- }
- assert(!"unsupported fmt char");
+ assert(*fmt == 'u' || *fmt == 'd' || !"unsupported fmt char");
+ chrs += mp_print_int(print, arg_value, *fmt == 'd', 10, 'a', flags, fill, width);
+ break;
}
#endif
default: