diff options
Diffstat (limited to 'transcode.c')
-rw-r--r-- | transcode.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/transcode.c b/transcode.c index 9462433130..5f9e4e9600 100644 --- a/transcode.c +++ b/transcode.c @@ -4115,10 +4115,9 @@ econv_putback(int argc, VALUE *argv, VALUE self) int putbackable; VALUE str, max; - rb_scan_args(argc, argv, "01", &max); - - if (NIL_P(max)) + if (!rb_check_arity(argc, 0, 1) || NIL_P(max = argv[0])) { n = rb_econv_putbackable(ec); + } else { n = NUM2INT(max); putbackable = rb_econv_putbackable(ec); |