summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
Diffstat (limited to 'random.c')
-rw-r--r--random.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/random.c b/random.c
index a179790115..a4a3265a88 100644
--- a/random.c
+++ b/random.c
@@ -1165,9 +1165,7 @@ rand_random(int argc, VALUE *argv, rb_random_t *rnd)
(void)NUM2LONG(vmax);
}
if (NIL_P(v)) {
- VALUE mesg = rb_str_new_cstr("invalid argument - ");
- rb_str_append(mesg, rb_obj_as_string(argv[0]));
- rb_exc_raise(rb_exc_new3(rb_eArgError, mesg));
+ rb_raise(rb_eArgError, "invalid argument - %"PRIsVALUE, argv[0]);
}
return v;