summaryrefslogtreecommitdiff
path: root/ext/stringio/stringio.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2024-10-26 21:08:55 +0900
committergit <[email protected]>2024-10-26 12:55:45 +0000
commitf513863c8186ebfbc2a4264929287f982fd147ea ()
treee485d1fd3639e743483d6bab10e53b9779922e2c /ext/stringio/stringio.c
parent393c5df00855829aaa7ce2f9964be673f5373ae0 (diff)
[ruby/stringio] Unreachable after an invalid argument exception
https://.com/ruby/stringio/commit/a2aab4721c
-rw-r--r--ext/stringio/stringio.c5
1 files changed, 4 insertions, 1 deletions
@@ -952,7 +952,10 @@ strio_ungetc(VALUE self, VALUE c)
enc = rb_enc_get(ptr->string);
len = rb_enc_codelen(cc, enc);
- if (len <= 0) rb_enc_uint_chr(cc, enc);
rb_enc_mbcput(cc, buf, enc);
return strio_unget_bytes(ptr, buf, len);
}