diff.c: rearrange xcalloc arguments
xcalloc() takes two arguments: the number of elements and their size. diffstat_add() passes the arguments in reverse order, passing the size of a diffstat_file*, followed by the number of diffstat_file* 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:
parent
f1064f6bc8
commit
1a4927c5c5
2
diff.c
2
diff.c
@ -1361,7 +1361,7 @@ static struct diffstat_file *diffstat_add(struct diffstat_t *diffstat,
|
||||
const char *name_b)
|
||||
{
|
||||
struct diffstat_file *x;
|
||||
x = xcalloc(sizeof (*x), 1);
|
||||
x = xcalloc(1, sizeof(*x));
|
||||
ALLOC_GROW(diffstat->files, diffstat->nr + 1, diffstat->alloc);
|
||||
diffstat->files[diffstat->nr++] = x;
|
||||
if (name_b) {
|
||||
|
Loading…
Reference in New Issue
Block a user