summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorTomoyuki Sahara <[email protected]>2014-12-16 09:07:45 +0900
committerTomoyuki Sahara <[email protected]>2014-12-16 09:07:45 +0900
commitee347f34171c878cc156f78a4aa0e49b0f3e04b7 (patch)
tree0875efd08a7530af2ee5bd92e5f3b05578351e97 /src
parentd1fee5892adb23565fddd9f8e762cc4ca8fd8cb3 (diff)
parentbe9e203563b761f271abc58e1854f027ad808641 (diff)
downloadmruby-ee347f34171c878cc156f78a4aa0e49b0f3e04b7.tar.gz
mruby-ee347f34171c878cc156f78a4aa0e49b0f3e04b7.zip
Merge pull request #31 from tmtm/fix-sysread-segv
FIX: IO#sysread occurs SEGV
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 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);