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

[PATCH 15/15] transport-helper.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.
transport_helper_init passes the arguments in reverse order, passing the
size of a helper_data*, followed by the number to allocate. Rearrgange
them so they are in the correct order.

Signed-off-by: Brian Gesiak <redacted>
---
 transport-helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/transport-helper.c b/transport-helper.c
index ad72fbd..cf48913 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -1002,7 +1002,7 @@ static struct ref *get_refs_list(struct transport *transport, int for_push)
 
 int transport_helper_init(struct transport *transport, const char *name)
 {
-	struct helper_data *data = xcalloc(sizeof(*data), 1);
+	struct helper_data *data = xcalloc(1, sizeof(*data));
 	data->name = name;
 
 	if (getenv("GIT_TRANSPORT_HELPER_DEBUG"))
-- 
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