diff --git a/py/lexer.c b/py/lexer.c index af413021b1..8088697d54 100644 --- a/py/lexer.c +++ b/py/lexer.c @@ -471,7 +471,7 @@ static void mp_lexer_next_token_into(mp_lexer_t *lex, mp_token_t *tok, bool firs case 'r': c = 0x0d; break; case 'x': { - uint num; + uint num = 0; if (!get_hex(lex, 2, &num)) { // TODO error message assert(0); diff --git a/py/vstr.c b/py/vstr.c index 18e6d2d0a8..b2e46c89f9 100644 --- a/py/vstr.c +++ b/py/vstr.c @@ -190,6 +190,7 @@ void vstr_cut_tail(vstr_t *vstr, int len) { } else { vstr->len -= len; } + vstr->buf[vstr->len] = 0; } void vstr_printf(vstr_t *vstr, const char *fmt, ...) {