Add assertion as originally intended; ref #4986

This commit is contained in:
Yukihiro "Matz" Matsumoto
2020-04-29 18:37:29 +09:00
parent 8c0dc55af8
commit 2fcdd3f8eb
+1
View File
@@ -1493,6 +1493,7 @@ mrb_io_readchar(mrb_state *mrb, mrb_value self)
#endif
mrb_get_args(mrb, "S", &buf);
mrb_assert(RSTRING_LEN(buf) > 0);
mrb_assert(RSTRING_PTR(buf) != NULL);
mrb_str_modify(mrb, RSTRING(buf));
#ifdef MRB_UTF8_STRING