Skip to content

Commit da7a478

Browse files
modocachegitster
authored andcommitted
remote.c: rearrange xcalloc arguments
xcalloc() takes two arguments: the number of elements and their size. parse_refspec_internal passes the arguments in reverse order, passing the size of a refspec, followed by the number to allocate. Rearrange them so they are in the correct order. Signed-off-by: Brian Gesiak <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8e1aa2f commit da7a478

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

remote.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ static void free_refspecs(struct refspec *refspec, int nr_refspec)
523523
static struct refspec *parse_refspec_internal(int nr_refspec, const char **refspec, int fetch, int verify)
524524
{
525525
int i;
526-
struct refspec *rs = xcalloc(sizeof(*rs), nr_refspec);
526+
struct refspec *rs = xcalloc(nr_refspec, sizeof(*rs));
527527

528528
for (i = 0; i < nr_refspec; i++) {
529529
size_t llen;

0 commit comments

Comments
 (0)