aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/io.c b/io.c
index ded34f07de..1754224af9 100644
--- a/io.c
+++ b/io.c
@@ -2022,11 +2022,11 @@ rb_io_each_byte(VALUE io)
p = fptr->rbuf+fptr->rbuf_off;
e = p + fptr->rbuf_len;
while (p < e) {
+ fptr->rbuf_off++;
+ fptr->rbuf_len--;
rb_yield(INT2FIX(*p & 0xff));
p++;
}
- fptr->rbuf_off += fptr->rbuf_len;
- fptr->rbuf_len = 0;
rb_io_check_readable(fptr);
READ_CHECK(fptr);
if (io_fillbuf(fptr) < 0) {