summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-03 11:13:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-03 11:13:15 +0000
commita35499268878ee7afff4cd782ce854fb609ba512 (patch)
tree651d068c03279f76752aa857d119652379b5a2d8 /random.c
parent1f71ea2fd23e640efb3300ba9a9432ff99801a15 (diff)
downloadruby-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.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/random.c b/random.c
index 0294533c05..0b0038cac8 100644
--- a/random.c
+++ b/random.c
@@ -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