1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Fix arguments order of IO#pwrite

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kazu 2017-04-03 12:30:04 +00:00
parent 8109114b18
commit b16f9112ed
2 changed files with 2 additions and 2 deletions

2
io.c
View file

@ -4945,7 +4945,7 @@ internal_pwrite_func(void *ptr)
* File.read("out") #=> "\u0000\u0000\u0000ABCDEF"
*/
static VALUE
rb_io_pwrite(VALUE io, VALUE offset, VALUE str)
rb_io_pwrite(VALUE io, VALUE str, VALUE offset)
{
rb_io_t *fptr;
ssize_t n;

View file

@ -3541,7 +3541,7 @@ __END__
def test_pwrite
make_tempfile { |t|
open(t.path, IO::RDWR) do |f|
assert_equal(3, f.pwrite(4, "ooo"))
assert_equal(3, f.pwrite("ooo", 4))
assert_equal("ooo", f.pread(3, 4))
end
}