Avoid memcpy() on copying structure.

This commit is contained in:
Masaki Muranaka
2012-10-15 13:56:45 +09:00
parent e8abf03ae5
commit 93b56e70ee
+1 -1
View File
@@ -415,7 +415,7 @@ range_initialize_copy(mrb_state *mrb, mrb_value copy)
if (!mrb_obj_is_instance_of(mrb, src, mrb_obj_class(mrb, copy))) {
mrb_raise(mrb, E_TYPE_ERROR, "wrong argument class");
}
memcpy(mrb_range_ptr(copy), mrb_range_ptr(src), sizeof(struct RRange));
*mrb_range_ptr(copy) = *mrb_range_ptr(src);
return copy;
}