From: Mark Atwood Date: Sun, 20 Apr 2008 20:17:05 +0000 (-0700) Subject: fix minor bug in compare_servers() X-Git-Tag: _20~1^2~14^2~5^2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=bb29047ba8d9d6409c44e1f0c97ce6958340419b;p=m6w6%2Flibmemcached fix minor bug in compare_servers() --- diff --git a/libmemcached/memcached_hosts.c b/libmemcached/memcached_hosts.c index 76fd5a01..bdbdcbb6 100644 --- a/libmemcached/memcached_hosts.c +++ b/libmemcached/memcached_hosts.c @@ -40,10 +40,7 @@ static int compare_servers(const void *p1, const void *p2) if (return_value == 0) { - if (a->port > b->port) - return_value++; - else - return_value--; + return_value= (int) (a->port - b->port); } return return_value;