From 4a02a8f74ddec92369d8bf2bd51e4191d0d42c5c Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Thu, 24 Mar 2016 19:43:08 +0200 Subject: [PATCH] py/stream: Fix object vs ptr usecase in mp_stream_writeall(). --- py/stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/stream.c b/py/stream.c index abc973d9e5..8216596a13 100644 --- a/py/stream.c +++ b/py/stream.c @@ -213,7 +213,7 @@ mp_uint_t mp_stream_writeall(mp_obj_t stream, const byte *buf, mp_uint_t size, i 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 out_sz = s->type->stream_p->write(s, buf, size, errcode); + mp_uint_t out_sz = s->type->stream_p->write(stream, buf, size, errcode); if (out_sz == MP_STREAM_ERROR) { return MP_STREAM_ERROR; }