diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-10-16 04:32:16 -0700 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-10-16 04:32:16 -0700 |
| commit | 019fd70f1b8ca08aea35e08ff0078cc4a7654f8a (patch) | |
| tree | 440a2b94ea593ab8ceac0c9a5017588fc5d7cff9 /src/range.c | |
| parent | e2b95158a0eec9c097665f46f24c51af97493c21 (diff) | |
| parent | 93b56e70ee26428e2f56dd82d3318622628aa62d (diff) | |
| download | mruby-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/range.c')
| -rw-r--r-- | src/range.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/range.c b/src/range.c index 98b9093ef..cdcfcca53 100644 --- a/src/range.c +++ b/src/range.c @@ -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; } |
