diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-03 11:13:15 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-03 11:13:15 +0000 |
commit | a35499268878ee7afff4cd782ce854fb609ba512 (patch) | |
tree | 651d068c03279f76752aa857d119652379b5a2d8 /random.c | |
parent | 1f71ea2fd23e640efb3300ba9a9432ff99801a15 (diff) | |
download | ruby-a35499268878ee7afff4cd782ce854fb609ba512.tar.gz |
random.c: fix fallback value
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'random.c')
-rw-r--r-- | random.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -1160,14 +1160,12 @@ random_s_bytes(VALUE obj, VALUE len) static VALUE range_values(VALUE vmax, VALUE *begp, VALUE *endp, int *exclp) { - VALUE end, r; + VALUE end; if (!rb_range_values(vmax, begp, &end, exclp)) return Qfalse; if (endp) *endp = end; if (NIL_P(end)) return Qnil; - r = rb_check_funcall(end, id_minus, 1, begp); - if (NIL_P(r)) return Qfalse; - return r; + return rb_check_funcall_default(end, id_minus, 1, begp, Qfalse); } static VALUE |