Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* ext/writev/writev.c: check for array type. Fixes #2

* test/test_writev.rb: appropriate test
  • Loading branch information...
commit 962e35e6595d30bc3e6b24c06cfc78313efbf8a4 1 parent 2bca786
@tenderlove authored
Showing with 15 additions and 0 deletions.
  1. +5 −0 CHANGELOG.rdoc
  2. +1 −0  ext/writev/writev.c
  3. +9 −0 test/test_writev.rb
View
5 CHANGELOG.rdoc
@@ -1,3 +1,8 @@
+Thu Oct 11 18:43:53 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/writev/writev.c: check for array type. Fixes #2
+ * test/test_writev.rb: appropriate test
+
=== 1.0.1 / 2011-08-19
* 1 bug fixed
View
1  ext/writev/writev.c
@@ -20,6 +20,7 @@ static VALUE rb_writev(VALUE io, VALUE list)
ssize_t written;
VALUE tmp;
+ Check_Type(list, T_ARRAY);
#ifdef IOV_MAX
if(RARRAY_LEN(list) > IOV_MAX)
#else
View
9 test/test_writev.rb
@@ -11,6 +11,15 @@ def test_writev
file.unlink
end
+ def test_checks_arguments
+ file = Tempfile.new('foo')
+
+ assert_raises TypeError do
+ file.writev('hello')
+ end
+ file.unlink
+ end
+
def test_length
file = Tempfile.new('foo')
Please sign in to comment.
Something went wrong with that request. Please try again.