Skip to content

Commit 1a4927c

Browse files
modocachegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f1064f6 commit 1a4927c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

diff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,7 @@ static struct diffstat_file *diffstat_add(struct diffstat_t *diffstat,
13611361
const char *name_b)
13621362
{
13631363
struct diffstat_file *x;
1364-
x = xcalloc(sizeof (*x), 1);
1364+
x = xcalloc(1, sizeof(*x));
13651365
ALLOC_GROW(diffstat->files, diffstat->nr + 1, diffstat->alloc);
13661366
diffstat->files[diffstat->nr++] = x;
13671367
if (name_b) {

0 commit comments

Comments
 (0)