summaryrefslogtreecommitdiff
path: root/pretty.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2019-06-15 18:36:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-06-18 01:15:04 (GMT)
commit921d49be86bd44ca290c8db6cc6f419dac3ed442 (patch)
tree73c8ec3613227772c56732a3d7da8e67e596e625 /pretty.c
parent177fbab747da4f58cb2a8ce010b3515c86dd67c9 (diff)
downloadgit-921d49be86bd44ca290c8db6cc6f419dac3ed442.zip
git-921d49be86bd44ca290c8db6cc6f419dac3ed442.tar.gz
git-921d49be86bd44ca290c8db6cc6f419dac3ed442.tar.bz2
use COPY_ARRAY for copying arrays
Convert calls of memcpy(3) to use COPY_ARRAY, which shortens and simplifies the code a bit. Patch generated by Coccinelle and contrib/coccinelle/array.cocci. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pretty.c')
-rw-r--r--pretty.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pretty.c b/pretty.c
index ced0485..e4ed14e 100644
--- a/pretty.c
+++ b/pretty.c
@@ -106,8 +106,8 @@ static void setup_commit_formats(void)
commit_formats_len = ARRAY_SIZE(builtin_formats);
builtin_formats_len = commit_formats_len;
ALLOC_GROW(commit_formats, commit_formats_len, commit_formats_alloc);
- memcpy(commit_formats, builtin_formats,
- sizeof(*builtin_formats)*ARRAY_SIZE(builtin_formats));
+ COPY_ARRAY(commit_formats, builtin_formats,
+ ARRAY_SIZE(builtin_formats));
git_config(git_pretty_formats_config, NULL);
}