summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-14 03:02:05 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-14 03:02:05 (GMT)
commit03af53f559078719e8a07380beaa8748853fce29 (patch)
tree1274295cdfa18ce006c62afbf93475ae9edee381
parenteeeb7ae8c06164dfe445db35f08eea0255c2617a (diff)
random.c: use PRIsVALUE
* random.c (rand_random): use PRIsVALUE to format an error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--random.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/random.c b/random.c
index a179790..a4a3265 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;