1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

zlib.c: fix unnormalized Fixnum

* ext/zlib/zlib.c (rb_gzfile_total_out): cast to long not to
  result in an unsigned long to normalized to Fixnum on LLP64
  platforms.  [ruby-core:81488]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-07-14 13:50:00 +00:00
parent 57464618ab
commit 5d6c1f42d5

View file

@ -3399,7 +3399,7 @@ rb_gzfile_total_out(VALUE obj)
if (total_out >= (uLong)buf_filled) {
return rb_uint2inum(total_out - buf_filled);
} else {
return LONG2FIX(-(buf_filled - total_out));
return LONG2FIX(-(buf_filled - (long)total_out));
}
}