diff.c: rearrange xcalloc arguments
authorBrian Gesiak <modocache@gmail.com>
Mon, 26 May 2014 15:33:47 +0000 (00:33 +0900)
committerJunio C Hamano <gitster@pobox.com>
Tue, 27 May 2014 21:02:03 +0000 (14:02 -0700)
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>
diff.c
diff --git a/diff.c b/diff.c
index f72769a1c492dfcac501032c54c3fb2ac0a4343e..146521e1947e36d010524dece848bfb03edfac24 100644 (file)
--- a/diff.c
+++ b/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) {