summaryrefslogtreecommitdiffstatshomepage
path: root/py/stream.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-07-23 00:25:46 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-07-23 00:25:46 +0300
commit4ecb700fe34491c563372ffa72387ef6d45ce5d8 (patch)
treee9f86fb7fdc3560b2a82ecc4c1b8bae2c62f1d74 /py/stream.c
parente1b1abc1e830b674ab0e773ae5cec414ed0dbee1 (diff)
downloadmicropython-4ecb700fe34491c563372ffa72387ef6d45ce5d8.tar.gz
micropython-4ecb700fe34491c563372ffa72387ef6d45ce5d8.zip
streams: Treat non-error output size as unsigned.
Diffstat (limited to 'py/stream.c')
-rw-r--r--py/stream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/stream.c b/py/stream.c
index 5e65f79bac..ad5855c706 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);