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

diff.c: rearrange xcalloc arguments

xcalloc() takes two arguments: the number of elements and their size.
diffstat_add() passes the arguments in reverse order, passing the
size of a diffstat_file*, followed by the number of diffstat_file* to
be allocated.

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>
上级 f1064f6b
......@@ -1361,7 +1361,7 @@ static struct diffstat_file *diffstat_add(struct diffstat_t *diffstat,
const char *name_b)
{
struct diffstat_file *x;
x = xcalloc(sizeof (*x), 1);
x = xcalloc(1, sizeof(*x));
ALLOC_GROW(diffstat->files, diffstat->nr + 1, diffstat->alloc);
diffstat->files[diffstat->nr++] = x;
if (name_b) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册