replace memcpy() with a magic number by two assignments as suggested by @cremno; close #2048

parent 3308177c
...@@ -401,7 +401,8 @@ sym_inspect(mrb_state *mrb, mrb_value sym) ...@@ -401,7 +401,8 @@ sym_inspect(mrb_state *mrb, mrb_value sym)
memcpy(RSTRING_PTR(str)+1, name, len); memcpy(RSTRING_PTR(str)+1, name, len);
if (!symname_p(name) || strlen(name) != len) { if (!symname_p(name) || strlen(name) != len) {
str = mrb_str_dump(mrb, str); str = mrb_str_dump(mrb, str);
memcpy(RSTRING_PTR(str), ":\"", 2); RSTRING_PTR(str)[0] = ':';
RSTRING_PTR(str)[1] = '"';
} }
return str; return str;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment