streams: Treat non-error output size as unsigned.

This commit is contained in:
Paul Sokolovsky 2014-07-23 00:25:46 +03:00
parent e1b1abc1e8
commit 4ecb700fe3
1 changed files with 1 additions and 1 deletions

View File

@ -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)); 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. // Finish reading.
// TODO what if we have read only half a non-ASCII char? // TODO what if we have read only half a non-ASCII char?
vstr_cut_tail_bytes(&vstr, more_bytes - out_sz); vstr_cut_tail_bytes(&vstr, more_bytes - out_sz);