mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 19:20:22 +01:00
stream: readall(): Make sure there's a trailing NUL char.
This commit is contained in:
@@ -289,6 +289,7 @@ STATIC mp_obj_t stream_readall(mp_obj_t self_in) {
|
||||
}
|
||||
|
||||
vstr.len = total_size;
|
||||
vstr.buf[total_size] = '\0';
|
||||
return mp_obj_new_str_from_vstr(STREAM_CONTENT_TYPE(o->type->stream_p), &vstr);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user