summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTOMITA Masahiro <[email protected]>2014-12-15 20:24:01 +0900
committerTOMITA Masahiro <[email protected]>2014-12-15 20:24:01 +0900
commitbe9e203563b761f271abc58e1854f027ad808641 (patch)
tree0875efd08a7530af2ee5bd92e5f3b05578351e97
parentd1fee5892adb23565fddd9f8e762cc4ca8fd8cb3 (diff)
downloadmruby-be9e203563b761f271abc58e1854f027ad808641.tar.gz
mruby-be9e203563b761f271abc58e1854f027ad808641.zip
FIX: IO#sysread occurs SEGV
-rw-r--r--src/io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/io.c b/src/io.c
index d7e1b0fba..e80483145 100644
--- a/src/io.c
+++ b/src/io.c
@@ -420,7 +420,7 @@ mrb_io_sysread(mrb_state *mrb, mrb_value io)
}
if (mrb_nil_p(buf)) {
- buf = mrb_str_new(mrb, "", maxlen);
+ buf = mrb_str_new(mrb, NULL, maxlen);
}
if (RSTRING_LEN(buf) != maxlen) {
buf = mrb_str_resize(mrb, buf, maxlen);