зеркало из https://github.com/microsoft/git.git
commit.c: rearrange xcalloc arguments
xcalloc() takes two arguments: the number of elements and their size. reduce_heads() passes the arguments in reverse order, passing the size of a commit*, followed by the number of commit* to be allocated. Rearrange them so they are in the correct order. Signed-off-by: Brian Gesiak <modocache@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Родитель
380694544d
Коммит
c4a7b0092b
2
commit.c
2
commit.c
|
@ -1031,7 +1031,7 @@ struct commit_list *reduce_heads(struct commit_list *heads)
|
||||||
p->item->object.flags |= STALE;
|
p->item->object.flags |= STALE;
|
||||||
num_head++;
|
num_head++;
|
||||||
}
|
}
|
||||||
array = xcalloc(sizeof(*array), num_head);
|
array = xcalloc(num_head, sizeof(*array));
|
||||||
for (p = heads, i = 0; p; p = p->next) {
|
for (p = heads, i = 0; p; p = p->next) {
|
||||||
if (p->item->object.flags & STALE) {
|
if (p->item->object.flags & STALE) {
|
||||||
array[i++] = p->item;
|
array[i++] = p->item;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче