summaryrefslogtreecommitdiffhomepage
path: root/src/time.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2012-10-16 04:32:16 -0700
committerYukihiro "Matz" Matsumoto <[email protected]>2012-10-16 04:32:16 -0700
commit019fd70f1b8ca08aea35e08ff0078cc4a7654f8a (patch)
tree440a2b94ea593ab8ceac0c9a5017588fc5d7cff9 /src/time.c
parente2b95158a0eec9c097665f46f24c51af97493c21 (diff)
parent93b56e70ee26428e2f56dd82d3318622628aa62d (diff)
downloadmruby-019fd70f1b8ca08aea35e08ff0078cc4a7654f8a.tar.gz
mruby-019fd70f1b8ca08aea35e08ff0078cc4a7654f8a.zip
Merge pull request #490 from monaka/pr-avoid-memcpy-on-copying-structures
Avoid memcpy() on copying structure.
Diffstat (limited to 'src/time.c')
-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;
}