mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 04:55:21 +02:00
IO#readpartial rejects bad args
Sometimes a sleepy developer will want to swap read_nonblock for readpartial forget to remove "exception: false" * io.c (io_getpartial): remove unused kwarg from template * test/ruby/test_io.rb (test_readpartial_bad_args): new [Bug #11885] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
509cfc4c37
commit
edea151a4b
3 changed files with 18 additions and 1 deletions
2
io.c
2
io.c
|
@ -2506,7 +2506,7 @@ io_getpartial(int argc, VALUE *argv, VALUE io, VALUE opts, int nonblock)
|
|||
long n, len;
|
||||
struct read_internal_arg arg;
|
||||
|
||||
rb_scan_args(argc, argv, "11:", &length, &str, NULL);
|
||||
rb_scan_args(argc, argv, "11", &length, &str);
|
||||
|
||||
if ((len = NUM2LONG(length)) < 0) {
|
||||
rb_raise(rb_eArgError, "negative length %ld given", len);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue