From e8abf03ae59b72bbc9c3af26eee33a9f4d17cc56 Mon Sep 17 00:00:00 2001 From: Masaki Muranaka Date: Mon, 15 Oct 2012 13:53:44 +0900 Subject: Avoid memcpy() on copying structure. --- src/time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/time.c b/src/time.c index ea8205c7b..09ebea78a 100644 --- a/src/time.c +++ b/src/time.c @@ -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; } -- cgit v1.2.3