diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-25 00:43:06 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-25 00:43:06 +0000 |
commit | 326474c2b3a4ce7631009e762d10c3c7171030db (patch) | |
tree | ad0439504e7fe51616e9757a28e869edca248a87 /ext/zlib | |
parent | cdffcebd102b6345be2690b9ad845e9d4876c6b7 (diff) | |
download | ruby-326474c2b3a4ce7631009e762d10c3c7171030db.tar.gz |
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
Diffstat (limited to 'ext/zlib')
-rw-r--r-- | ext/zlib/zlib.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index d5a18ddd63..8cec7fbc33 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -3097,9 +3097,7 @@ gzfile_s_open(int argc, VALUE *argv, VALUE klass, const char *mode) { VALUE io, filename; - if (argc < 1) { - rb_raise(rb_eArgError, "wrong number of arguments (0 for 1)"); - } + rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS); filename = argv[0]; io = rb_file_open_str(filename, mode); argv[0] = io; |