mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Avoid memcpy() on copying structure.
This commit is contained in:
+1
-1
@@ -559,7 +559,7 @@ mrb_time_initialize_copy(mrb_state *mrb, mrb_value copy)
|
||||
DATA_PTR(copy) = mrb_malloc(mrb, sizeof(struct mrb_time));
|
||||
DATA_TYPE(copy) = &mrb_time_type;
|
||||
}
|
||||
memcpy(DATA_PTR(copy), DATA_PTR(src), sizeof(struct mrb_time));
|
||||
*(struct mrb_time *)DATA_PTR(copy) = *(struct mrb_time *)DATA_PTR(src);
|
||||
return copy;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user