aboutsummaryrefslogtreecommitdiffstats
path: root/ext/stringio
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-25 00:43:06 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-25 00:43:06 +0000
commit326474c2b3a4ce7631009e762d10c3c7171030db (patch)
treead0439504e7fe51616e9757a28e869edca248a87 /ext/stringio
parentcdffcebd102b6345be2690b9ad845e9d4876c6b7 (diff)
downloadruby-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/stringio')
-rw-r--r--ext/stringio/stringio.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index c57b40fd93..9c23daf0bb 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -1271,6 +1271,7 @@ strio_read(int argc, VALUE *argv, VALUE self)
long len;
int binary = 0;
+ rb_check_arity(argc, 0, 2);
switch (argc) {
case 2:
str = argv[1];
@@ -1307,8 +1308,6 @@ strio_read(int argc, VALUE *argv, VALUE self)
len -= ptr->pos;
}
break;
- default:
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
if (NIL_P(str)) {
str = strio_substr(ptr, ptr->pos, len);