summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--io.c4
2 files changed, 5 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 47d468fc83..7ffd9a1f89 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,6 @@
-Thu Mar 12 05:19:22 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Mar 12 05:22:50 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (copy_stream_fallback_body): off_t may be larger than long.
* iseq.c (rb_iseq_disasm): RSTRING_LEN() returns long.
diff --git a/io.c b/io.c
index e3b6281562..a043573a69 100644
--- a/io.c
+++ b/io.c
@@ -7616,7 +7616,7 @@ copy_stream_fallback_body(VALUE arg)
const int buflen = 16*1024;
VALUE n;
VALUE buf = rb_str_buf_new(buflen);
- long rest = stp->copy_length;
+ off_t rest = stp->copy_length;
off_t off = stp->src_offset;
ID read_method = id_readpartial;
@@ -7635,7 +7635,7 @@ copy_stream_fallback_body(VALUE arg)
else {
if (rest == 0)
break;
- l = buflen < rest ? buflen : rest;
+ l = buflen < rest ? buflen : (long)rest;
}
if (stp->src_fd == -1) {
rb_funcall(stp->src, read_method, 2, INT2FIX(l), buf);