diff options
author | René Scharfe <l.s.r@web.de> | 2019-09-19 22:48:30 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-09-20 11:11:26 -0700 |
commit | 7bd97d6dff3b09600465b818163a413115dad217 (patch) | |
tree | 61f80410d7bcafe71c0bfc3b0dfecd77093c38e8 /builtin/upload-archive.c | |
parent | Git 2.23 (diff) | |
download | tgif-7bd97d6dff3b09600465b818163a413115dad217.tar.xz |
git: use COPY_ARRAY and MOVE_ARRAY in handle_alias()
Use the macro COPY_ARRAY to copy array elements and MOVE_ARRAY to do the
same for moving them backwards in an array with potential overlap. The
result is shorter and safer, as it infers the element type automatically
and does a (very) basic type compatibility check for its first two
arguments.
These cases were missed by Coccinelle and contrib/coccinelle/array.cocci
because the type of the elements is "const char *", not "char *", and
the rules in the semantic patch cautiously insist on the sizeof operator
being used on exactly the same type to avoid generating transformations
that introduce subtle bugs into tricky code.
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/upload-archive.c')
0 files changed, 0 insertions, 0 deletions