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>
Brian Gesiak committed
May 27, 2014 at 00:33 UTC
1a4927c5c54f737353323fd7bcd2045ee0985e1a
1 file changed
+1
-1
diff.c
+1
-1
@@ -1361,7 +1361,7 @@ static struct diffstat_file *diffstat_add(struct diffstat_t *diffstat,
1361
const char *name_b)
1362
{
1363
struct diffstat_file *x;
1364
- x = xcalloc(sizeof (*x), 1);
1364
+ x = xcalloc(1, sizeof(*x));
1365
ALLOC_GROW(diffstat->files, diffstat->nr + 1, diffstat->alloc);
1366
diffstat->files[diffstat->nr++] = x;
1367
if (name_b) {