diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-03-27 12:58:33 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-03-27 12:58:33 +0300 |
commit | 53ad5edc01aee3d469feaaafa389be3d686548bb (patch) | |
tree | 788804648e4883820281e14dfb95cc4223824f5e /py | |
parent | 87c783b45487fba24615838ad297bf755cb344d3 (diff) | |
download | micropython-53ad5edc01aee3d469feaaafa389be3d686548bb.tar.gz micropython-53ad5edc01aee3d469feaaafa389be3d686548bb.zip |
py/stream: Fix stupid thinko with variable naming/shadowing.
Diffstat (limited to 'py')
-rw-r--r-- | py/stream.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/py/stream.c b/py/stream.c index 8216596a13..89b9e2af46 100644 --- a/py/stream.c +++ b/py/stream.c @@ -211,16 +211,16 @@ void mp_stream_write_adaptor(void *self, const char *buf, size_t len) { // Works only with blocking streams mp_uint_t mp_stream_writeall(mp_obj_t stream, const byte *buf, mp_uint_t size, int *errcode) { mp_obj_base_t* s = (mp_obj_base_t*)MP_OBJ_TO_PTR(stream); - mp_uint_t sz = size; - while (sz > 0) { + mp_uint_t org_size = size; + while (size > 0) { mp_uint_t out_sz = s->type->stream_p->write(stream, buf, size, errcode); if (out_sz == MP_STREAM_ERROR) { return MP_STREAM_ERROR; } buf += out_sz; - sz -= out_sz; + size -= out_sz; } - return size; + return org_size; } STATIC mp_obj_t stream_write_method(mp_obj_t self_in, mp_obj_t arg) { |