diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-07-10 01:25:38 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-07-10 01:25:38 +0300 |
commit | e8d259064146f24abb1280aff0ca3ead20218244 (patch) | |
tree | 2a0f4b7ee4f9059928ea9619d14a42ddf4d0c163 /packfile.c | |
parent | ceca45541d0046544cc95acb6b849c14637e0e3e (diff) | |
parent | 921d49be86bd44ca290c8db6cc6f419dac3ed442 (diff) |
Merge branch 'rs/copy-array'
Code clean-up.
* rs/copy-array:
use COPY_ARRAY for copying arrays
coccinelle: use COPY_ARRAY for copying arrays
Diffstat (limited to 'packfile.c')
-rw-r--r-- | packfile.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packfile.c b/packfile.c index ed61187504..c0d83fdfed 100644 --- a/packfile.c +++ b/packfile.c @@ -1272,7 +1272,7 @@ static enum object_type packed_to_object_type(struct repository *r, if (poi_stack_nr >= poi_stack_alloc && poi_stack == small_poi_stack) { poi_stack_alloc = alloc_nr(poi_stack_nr); ALLOC_ARRAY(poi_stack, poi_stack_alloc); - memcpy(poi_stack, small_poi_stack, sizeof(off_t)*poi_stack_nr); + COPY_ARRAY(poi_stack, small_poi_stack, poi_stack_nr); } else { ALLOC_GROW(poi_stack, poi_stack_nr+1, poi_stack_alloc); } @@ -1682,8 +1682,8 @@ void *unpack_entry(struct repository *r, struct packed_git *p, off_t obj_offset, && delta_stack == small_delta_stack) { delta_stack_alloc = alloc_nr(delta_stack_nr); ALLOC_ARRAY(delta_stack, delta_stack_alloc); - memcpy(delta_stack, small_delta_stack, - sizeof(*delta_stack)*delta_stack_nr); + COPY_ARRAY(delta_stack, small_delta_stack, + delta_stack_nr); } else { ALLOC_GROW(delta_stack, delta_stack_nr+1, delta_stack_alloc); } |