summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar SZEDER Gábor <szeder.dev@gmail.com>2019-11-12 11:38:13 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-12-06 13:29:04 -0800
commitbf43abc6e60fc9732a287f529a6cedcbdfe2a74c (patch)
tree279315b028dd69ac3fabb054e78c49defe964ebe
parentname-rev: avoid unnecessary cast in name_ref() (diff)
downloadtgif-bf43abc6e60fc9732a287f529a6cedcbdfe2a74c.tar.xz
name-rev: use sizeof(*ptr) instead of sizeof(type) in allocation
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/name-rev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/name-rev.c b/builtin/name-rev.c
index e40f51c2b4..7e003c2702 100644
--- a/builtin/name-rev.c
+++ b/builtin/name-rev.c
@@ -102,7 +102,7 @@ static void name_rev(struct commit *commit,
}
if (name == NULL) {
- name = xmalloc(sizeof(rev_name));
+ name = xmalloc(sizeof(*name));
set_commit_rev_name(commit, name);
goto copy_data;
} else if (is_better_name(name, taggerdate, distance, from_tag)) {