aboutsummaryrefslogtreecommitdiffstats
path: root/parse-options.c
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder.dev@gmail.com>2018-01-22 18:50:09 +0100
committerJunio C Hamano <gitster@pobox.com>2018-01-22 11:32:51 -0800
commitf919ffebed3c570bf3c2a5f36444527ea5df42de (patch)
tree3d89f307b743c893848413a72d32b36e9fd8ec17 /parse-options.c
parent8279ed033f703d4115bee620dccd32a9ec94d9aa (diff)
downloadgit-f919ffebed3c570bf3c2a5f36444527ea5df42de.tar.gz
Use MOVE_ARRAY
Use the helper macro MOVE_ARRAY to move arrays. This is shorter and safer, as it automatically infers the size of elements. Patch generated by Coccinelle and contrib/coccinelle/array.cocci in Travis CI's static analysis build job. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'parse-options.c')
-rw-r--r--parse-options.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse-options.c b/parse-options.c
index fca7159646..d02eb8b015 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -525,7 +525,7 @@ unknown:
int parse_options_end(struct parse_opt_ctx_t *ctx)
{
- memmove(ctx->out + ctx->cpidx, ctx->argv, ctx->argc * sizeof(*ctx->out));
+ MOVE_ARRAY(ctx->out + ctx->cpidx, ctx->argv, ctx->argc);
ctx->out[ctx->cpidx + ctx->argc] = NULL;
return ctx->cpidx + ctx->argc;
}