Thread (27 messages) flat view 27 messages, 4 authors, 2016-06-15
STALE3744d

[PATCH 06/15] diff.c: rearrange xcalloc arguments

From: Brian Gesiak <hidden>
Date: 2016-06-15 23:01:22
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help