Skip to content

Commit 53ad5ed

Browse files
committed
py/stream: Fix stupid thinko with variable naming/shadowing.
1 parent 87c783b commit 53ad5ed

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

py/stream.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,16 +211,16 @@ void mp_stream_write_adaptor(void *self, const char *buf, size_t len) {
211211
// Works only with blocking streams
212212
mp_uint_t mp_stream_writeall(mp_obj_t stream, const byte *buf, mp_uint_t size, int *errcode) {
213213
mp_obj_base_t* s = (mp_obj_base_t*)MP_OBJ_TO_PTR(stream);
214-
mp_uint_t sz = size;
215-
while (sz > 0) {
214+
mp_uint_t org_size = size;
215+
while (size > 0) {
216216
mp_uint_t out_sz = s->type->stream_p->write(stream, buf, size, errcode);
217217
if (out_sz == MP_STREAM_ERROR) {
218218
return MP_STREAM_ERROR;
219219
}
220220
buf += out_sz;
221-
sz -= out_sz;
221+
size -= out_sz;
222222
}
223-
return size;
223+
return org_size;
224224
}
225225

226226
STATIC mp_obj_t stream_write_method(mp_obj_t self_in, mp_obj_t arg) {

0 commit comments

Comments
 (0)