From: Brian Gesiak Date: Mon, 26 May 2014 15:33:47 GMT Subject: [PATCH 06/15] diff.c: rearrange xcalloc arguments Message-ID: <1401118436-66090-7-git-send-email-modocache@gmail.com> In-Reply-To: <1401118436-66090-1-git-send-email-modocache@gmail.com> 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. Rearrgange them so they are in the correct order. Signed-off-by: Brian Gesiak --- diff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diff.c b/diff.c index 635dee2..a71dfde 100644 --- a/diff.c +++ b/diff.c @@ -1360,7 +1360,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)); if (diffstat->nr == diffstat->alloc) { diffstat->alloc = alloc_nr(diffstat->alloc); diffstat->files = xrealloc(diffstat->files, -- 2.0.0.rc1.543.gc8042da