X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=server-info.c;h=df19e49b5be75f2cc75e24ba6cda0c94631b434d;hb=4b3511b0f8422fd2c5b1b37c9655ae2ce904bca5;hp=7d7bcb2188e8f4a65f83a4693220864d0a255951;hpb=5e80092f7e6db09a40a62e837ca3f74f0bc5ad73;p=git.git diff --git a/server-info.c b/server-info.c index 7d7bcb21..df19e49b 100644 --- a/server-info.c +++ b/server-info.c @@ -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)