diff --git a/py/frozenmod.c b/py/frozenmod.c index 84df30b895..440ae0aacf 100644 --- a/py/frozenmod.c +++ b/py/frozenmod.c @@ -46,7 +46,7 @@ mp_lexer_t *mp_find_frozen_module(const char *str, int len) { mp_lexer_t *lex = mp_lexer_new_from_str_len(MP_QSTR_, s, *sz_ptr, 0); return lex; } - s += l + 1 + *sz_ptr++; + s += (l + 1) + (*sz_ptr++ + 1); } return NULL; } diff --git a/tools/make-frozen.py b/tools/make-frozen.py index 18368e218f..7c3865cc41 100755 --- a/tools/make-frozen.py +++ b/tools/make-frozen.py @@ -55,5 +55,5 @@ for f, st in modules: data = data[1:] data = data[1:-1] data = data.replace('"', '\\"') - print('"%s"' % data) + print('"%s\\0"' % data) print("};")