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

ext/stringio/stringio.c (strio_read): "binray" is always zero here

Remove unused conditional expression to suppress Coverity Scan warnings.
This commit is contained in:
Yusuke Endoh 2019-07-15 00:19:41 +09:00
parent e6f188ea03
commit deb5e58230

View file

@ -1409,7 +1409,7 @@ strio_read(int argc, VALUE *argv, VALUE self)
case 0:
len = RSTRING_LEN(ptr->string);
if (len <= ptr->pos) {
rb_encoding *enc = binary ? rb_ascii8bit_encoding() : get_enc(ptr);
rb_encoding *enc = get_enc(ptr);
if (NIL_P(str)) {
str = rb_str_new(0, 0);
}