mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mrb_str_new(mrb, "", len) creates an unmodifiable string object; ref #2674
This commit is contained in:
+1
-1
@@ -163,7 +163,7 @@ str_new(mrb_state *mrb, const char *p, size_t len)
|
||||
{
|
||||
struct RString *s;
|
||||
|
||||
if (mrb_ro_data_p(p)) {
|
||||
if (p && mrb_ro_data_p(p)) {
|
||||
return str_new_static(mrb, p, len);
|
||||
}
|
||||
s = mrb_obj_alloc_string(mrb);
|
||||
|
||||
Reference in New Issue
Block a user