diff --git a/extmod/network_ppp_lwip.c b/extmod/network_ppp_lwip.c index 12205521f6..15e3ba0292 100644 --- a/extmod/network_ppp_lwip.c +++ b/extmod/network_ppp_lwip.c @@ -145,8 +145,8 @@ static mp_obj_t network_ppp_poll(size_t n_args, const mp_obj_t *args) { } mp_int_t total_len = 0; - mp_obj_t stream = self->stream; - while (stream != mp_const_none) { + mp_obj_t stream; + while ((stream = self->stream) != mp_const_none) { uint8_t buf[256]; int err; mp_uint_t len = mp_stream_rw(stream, buf, sizeof(buf), &err, 0); diff --git a/ports/esp32/network_ppp.c b/ports/esp32/network_ppp.c index 18e0c88168..97536267b8 100644 --- a/ports/esp32/network_ppp.c +++ b/ports/esp32/network_ppp.c @@ -153,8 +153,8 @@ static mp_obj_t network_ppp_poll(size_t n_args, const mp_obj_t *args) { } mp_int_t total_len = 0; - mp_obj_t stream = self->stream; - while (stream != mp_const_none) { + mp_obj_t stream; + while ((stream = self->stream) != mp_const_none) { uint8_t buf[256]; int err; mp_uint_t len = mp_stream_rw(stream, buf, sizeof(buf), &err, 0);