提交 da7a478b 编写于 作者: B Brian Gesiak 提交者: Junio C Hamano

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: NBrian Gesiak <modocache@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 8e1aa2f7
......@@ -523,7 +523,7 @@ static void free_refspecs(struct refspec *refspec, int nr_refspec)
static struct refspec *parse_refspec_internal(int nr_refspec, const char **refspec, int fetch, int verify)
{
int i;
struct refspec *rs = xcalloc(sizeof(*rs), nr_refspec);
struct refspec *rs = xcalloc(nr_refspec, sizeof(*rs));
for (i = 0; i < nr_refspec; i++) {
size_t llen;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册