Skip to content

Commit ddfee9d

Browse files
committedJan 15, 2018
use num2int in StringIO#ungetc
1 parent 7bd2b2c commit ddfee9d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎core/src/main/java/org/jruby/ext/stringio/StringIO.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ public IRubyObject ungetc(ThreadContext context, IRubyObject arg) {
10691069

10701070
if (arg.isNil()) return arg;
10711071
if (arg instanceof RubyInteger) {
1072-
int len, cc = ((RubyInteger) arg).getIntValue();
1072+
int len, cc = RubyNumeric.num2int(arg);
10731073
byte[] buf = new byte[16];
10741074

10751075
enc = getEncoding();

0 commit comments

Comments
 (0)
Please sign in to comment.