Skip to content

Commit

Permalink
streams: Treat non-error output size as unsigned.
Browse files Browse the repository at this point in the history
  • Loading branch information
pfalcon committed Jul 22, 2014
1 parent e1b1abc commit 4ecb700
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion py/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4ecb700

Please sign in to comment.