summaryrefslogtreecommitdiff
path: root/ext/zlib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-25 01:59:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-25 01:59:15 +0000
commitaeb8d7f5e591915d7c4e290a3bee3185c84f0630 (patch)
treefd349699a0a6076edca29cd49a3607772b5b4eb4 /ext/zlib
parentbd3c7a7e90466158dac4139e3be7dce6f959cfdc (diff)
* ext/zlib/zlib.c (gzfile_read, gzfile_readpartial): length should
be long. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/zlib')
-rw-r--r--ext/zlib/zlib.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 3dd5699bdf..458a7009e0 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -141,7 +141,7 @@ static void gzfile_check_footer(struct gzfile*);
static void gzfile_write(struct gzfile*, Bytef*, uInt);
static long gzfile_read_more(struct gzfile*);
static void gzfile_calc_crc(struct gzfile*, VALUE);
-static VALUE gzfile_read(struct gzfile*, int);
+static VALUE gzfile_read(struct gzfile*, long);
static VALUE gzfile_read_all(struct gzfile*);
static void gzfile_ungets(struct gzfile*, const Bytef*, int);
static void gzfile_ungetbyte(struct gzfile*, int);
@@ -2205,12 +2205,12 @@ gzfile_newstr(struct gzfile *gz, VALUE str)
}
static VALUE
-gzfile_read(struct gzfile *gz, int len)
+gzfile_read(struct gzfile *gz, long len)
{
VALUE dst;
if (len < 0)
- rb_raise(rb_eArgError, "negative length %d given", len);
+ rb_raise(rb_eArgError, "negative length %ld given", len);
if (len == 0)
return rb_str_new(0, 0);
while (!ZSTREAM_IS_FINISHED(&gz->z) && gz->z.buf_filled < len) {
@@ -2229,15 +2229,15 @@ gzfile_read(struct gzfile *gz, int len)
}
static VALUE
-gzfile_readpartial(struct gzfile *gz, int len, VALUE outbuf)
+gzfile_readpartial(struct gzfile *gz, long len, VALUE outbuf)
{
VALUE dst;
if (len < 0)
- rb_raise(rb_eArgError, "negative length %d given", len);
+ rb_raise(rb_eArgError, "negative length %ld given", len);
if (!NIL_P(outbuf))
- OBJ_TAINT(outbuf);
+ OBJ_TAINT(outbuf);
if (len == 0) {
if (NIL_P(outbuf))
@@ -3154,7 +3154,7 @@ rb_gzreader_read(int argc, VALUE *argv, VALUE obj)
{
struct gzfile *gz = get_gzfile(obj);
VALUE vlen;
- int len;
+ long len;
rb_scan_args(argc, argv, "01", &vlen);
if (NIL_P(vlen)) {
@@ -3163,7 +3163,7 @@ rb_gzreader_read(int argc, VALUE *argv, VALUE obj)
len = NUM2INT(vlen);
if (len < 0) {
- rb_raise(rb_eArgError, "negative length %d given", len);
+ rb_raise(rb_eArgError, "negative length %ld given", len);
}
return gzfile_read(gz, len);
}
@@ -3183,13 +3183,13 @@ rb_gzreader_readpartial(int argc, VALUE *argv, VALUE obj)
{
struct gzfile *gz = get_gzfile(obj);
VALUE vlen, outbuf;
- int len;
+ long len;
rb_scan_args(argc, argv, "11", &vlen, &outbuf);
len = NUM2INT(vlen);
if (len < 0) {
- rb_raise(rb_eArgError, "negative length %d given", len);
+ rb_raise(rb_eArgError, "negative length %ld given", len);
}
if (!NIL_P(outbuf))
Check_Type(outbuf, T_STRING);