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 <modocache@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brian Gesiak committed May 27, 2014 at 00:33 UTC da7a478bc055bd5fdbdf1895367c803d528cf579
1 file changed +1 -1
remote.c
+1 -1
@@ -523,7 +523,7 @@ static void free_refspecs(struct refspec *refspec, int nr_refspec)
523 static struct refspec *parse_refspec_internal(int nr_refspec, const char **refspec, int fetch, int verify)
524 {
525 int i;
526 - struct refspec *rs = xcalloc(sizeof(*rs), nr_refspec);
526 + struct refspec *rs = xcalloc(nr_refspec, sizeof(*rs));
527
528 for (i = 0; i < nr_refspec; i++) {
529 size_t llen;