summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorksss <[email protected]>2017-05-21 22:55:28 +0900
committerksss <[email protected]>2017-05-22 11:47:45 +0900
commit0bbd60b52348a9c1938d8cce7a1d5aea996e7e1e (patch)
tree033ee16136bdb3404d5e081d7a1f5c2fb3d8aeb7 /src
parent86edc9ab8541d15b470dd4fe0bac1e136c2ffced (diff)
downloadmruby-0bbd60b52348a9c1938d8cce7a1d5aea996e7e1e.tar.gz
mruby-0bbd60b52348a9c1938d8cce7a1d5aea996e7e1e.zip
IO#sysread should raise error when invalid pos
Diffstat (limited to 'src')
-rw-r--r--src/io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/io.c b/src/io.c
index f15f182f2..7a1121338 100644
--- a/src/io.c
+++ b/src/io.c
@@ -623,7 +623,7 @@ mrb_io_sysread(mrb_state *mrb, mrb_value io)
mrb_get_args(mrb, "i|S", &maxlen, &buf);
if (maxlen < 0) {
- return mrb_nil_value();
+ mrb_raise(mrb, E_ARGUMENT_ERROR, "negative expanding string size");
}
else if (maxlen == 0) {
return mrb_str_new(mrb, NULL, maxlen);