Use memcpy instead of strncpy

This commit is contained in:
Masaki Muranaka
2012-07-23 10:18:11 +09:00
parent 8b6f6faf1e
commit d73a54d80a
+1 -1
View File
@@ -339,7 +339,7 @@ sym_inspect(mrb_state *mrb, mrb_value sym)
memcpy(RSTRING(str)->ptr+1, name, len);
if (!symname_p(name) || strlen(name) != len) {
str = mrb_str_dump(mrb, str);
strncpy(RSTRING(str)->ptr, ":\"", 2);
memcpy(RSTRING(str)->ptr, ":\"", 2);
}
return str;
}