提交 2dee5816 编写于 作者: J Junio C Hamano

qsort(): ptrdiff_t may be larger than int

This is a companion patch to e23eff8b
commit.  The same logic, the same rationale that a comparison
function that returns an int should not just compute a ptrdiff_t
and return it.
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 c82365dc
......@@ -140,7 +140,12 @@ static int compare_info(const void *a_, const void *b_)
return 1;
/* then it does not matter but at least keep the comparison stable */
return (*a)->p - (*b)->p;
if ((*a)->p == (*b)->p)
return 0;
else if ((*a)->p < (*b)->p)
return -1;
else
return 1;
}
static void init_pack_info(const char *infofile, int force)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册