From 4ecb700fe34491c563372ffa72387ef6d45ce5d8 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 23 Jul 2014 00:25:46 +0300 Subject: [PATCH] streams: Treat non-error output size as unsigned. --- py/stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/stream.c b/py/stream.c index 5e65f79bac75..ad5855c70603 100644 --- a/py/stream.c +++ b/py/stream.c @@ -113,7 +113,7 @@ STATIC mp_obj_t stream_read(uint n_args, const mp_obj_t *args) { nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_OSError, "[Errno %d]", error)); } - if (out_sz < more_bytes) { + if ((mp_uint_t)out_sz < more_bytes) { // Finish reading. // TODO what if we have read only half a non-ASCII char? vstr_cut_tail_bytes(&vstr, more_bytes - out_sz);