summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMasaki Muranaka <[email protected]>2012-10-15 13:53:44 +0900
committerMasaki Muranaka <[email protected]>2012-10-15 13:53:44 +0900
commite8abf03ae59b72bbc9c3af26eee33a9f4d17cc56 (patch)
tree8a2bcb119d379e2bc08797adac7f74d508ad9250 /src
parent170d5e7181cef90daa63c39b16ea66f6bd2b17b4 (diff)
downloadmruby-e8abf03ae59b72bbc9c3af26eee33a9f4d17cc56.tar.gz
mruby-e8abf03ae59b72bbc9c3af26eee33a9f4d17cc56.zip
Avoid memcpy() on copying structure.
Diffstat (limited to 'src')
-rw-r--r--src/time.c2
1 files changed, 1 insertions, 1 deletions
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;
}