From 898fd2ed2ad13d8c18b6a96304a8ea75ffd96b59 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 25 Oct 2015 00:43:06 +0000 Subject: use rb_check_arity [ci skip] * ext: use rb_check_arity and rb_error_arity to raise ArgumentError. [Feature #9025] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/syslog/syslog.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'ext/syslog') diff --git a/ext/syslog/syslog.c b/ext/syslog/syslog.c index 6aa2cd8484..9c41795f5b 100644 --- a/ext/syslog/syslog.c +++ b/ext/syslog/syslog.c @@ -304,9 +304,7 @@ static VALUE mSyslog_log(int argc, VALUE *argv, VALUE self) { VALUE pri; - if (argc < 2) { - rb_raise(rb_eArgError, "wrong number of arguments (%d for 2+)", argc); - } + rb_check_arity(argc, 2, UNLIMITED_ARGUMENTS); argc--; pri = *argv++; -- cgit v1.2.1