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

This commit is contained in:
Yukihiro "Matz" Matsumoto
2014-04-12 14:28:43 +09:00
parent 3308177c4d
commit 18ee842bea
+2 -1
View File
@@ -401,7 +401,8 @@ sym_inspect(mrb_state *mrb, mrb_value sym)
memcpy(RSTRING_PTR(str)+1, name, len);
if (!symname_p(name) || strlen(name) != len) {
str = mrb_str_dump(mrb, str);
memcpy(RSTRING_PTR(str), ":\"", 2);
RSTRING_PTR(str)[0] = ':';
RSTRING_PTR(str)[1] = '"';
}
return str;
}