Skip to content

Commit

Permalink
transport-helper.c: rearrange xcalloc arguments
Browse files Browse the repository at this point in the history
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.

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>
  • Loading branch information
Brian Gesiak authored and Junio C Hamano committed May 27, 2014
1 parent da7a478 commit 92e25b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion transport-helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,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"))
Expand Down

0 comments on commit 92e25b6

Please sign in to comment.