Skip to content

Commit be24e6a

Browse files
committed
py/mpprint: Prevent case fall-through when assert is disabled.
Signed-off-by: Damien George <damien@micropython.org>
1 parent 6a3d70d commit be24e6a

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

py/mpprint.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -557,11 +557,9 @@ int mp_vprintf(const mp_print_t *print, const char *fmt, va_list args) {
557557
case 'l': {
558558
unsigned long long int arg_value = va_arg(args, unsigned long long int);
559559
++fmt;
560-
if (*fmt == 'u' || *fmt == 'd') {
561-
chrs += mp_print_int(print, arg_value, *fmt == 'd', 10, 'a', flags, fill, width);
562-
break;
563-
}
564-
assert(!"unsupported fmt char");
560+
assert(*fmt == 'u' || *fmt == 'd' || !"unsupported fmt char");
561+
chrs += mp_print_int(print, arg_value, *fmt == 'd', 10, 'a', flags, fill, width);
562+
break;
565563
}
566564
#endif
567565
default:

0 commit comments

Comments
 (0)