summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--io.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e7b0fdf8ee..966b72fcbb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Apr 8 06:51:57 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (io_unread): cast as long the value for extra_max.
+ [ruby-core:44137] [Bug #6257]
+
Sun Apr 8 06:46:48 2012 NARUSE, Yui <naruse@ruby-lang.org>
* lib/webrick/httpresponse.rb (WEBrick::HTTPResponse#send_body_io):
diff --git a/io.c b/io.c
index fac42c710b..ca7f1b2e92 100644
--- a/io.c
+++ b/io.c
@@ -455,7 +455,7 @@ io_unread(rb_io_t *fptr)
}
/* add extra offset for removed '\r' in rbuf */
- extra_max = pos - fptr->rbuf.len;
+ extra_max = (long)(pos - fptr->rbuf.len);
p = fptr->rbuf.ptr + fptr->rbuf.off;
for (i = 0; i < fptr->rbuf.len; i++) {
if (*p == '\n') newlines++;