summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-14 21:10:34 (GMT)
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-14 21:10:34 (GMT)
commit7316302483182a73136b00ad368585e551cbd86f (patch)
treed32188711001581a5e7e21d6669f6c4e91fcb497 /random.c
parent35c356ea72094dbbf1397d8f5acd065bd23d1177 (diff)
* include/ruby/intern.h: Add rb_check_arity, rb_error_arity [#6085]
* array.c: Use rb_check_arity / rb_error_arity * class.c: ditto * enumerator.c: ditto * eval.c: ditto * file.c: ditto * hash.c: ditto * numeric.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * re.c: ditto * signal.c: ditto * string.c: ditto * struct.c: ditto * transcode.c: ditto * vm_eval.c: ditto * vm_insnhelper.c: ditto & implementation of rb_error_arity * test/ruby/test_arity.rb: tests for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'random.c')
-rw-r--r--random.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/random.c b/random.c
index 616cd68..1a93779 100644
--- a/random.c
+++ b/random.c
@@ -1168,8 +1168,8 @@ rand_random(int argc, VALUE *argv, rb_random_t *rnd)
if (argc == 0) {
return rb_float_new(genrand_real(&rnd->mt));
}
- else if (argc != 1) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 0..1)", argc);
+ else {
+ rb_check_arity(argc, 0, 1);
}
vmax = argv[0];
if (NIL_P(vmax)) {