From: Nick Mathewson Date: Tue, 12 Jul 2011 15:23:55 +0000 (-0400) Subject: Avoid warning in broken_state_count_compare X-Git-Tag: tor-0.2.3.2-alpha~19 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9a6642f6f5681fe92b17b87304126d2a3b2dec02;p=thirdparty%2Ftor.git Avoid warning in broken_state_count_compare --- diff --git a/src/or/connection_or.c b/src/or/connection_or.c index 94f8e227bb..2871f1f36a 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -236,7 +236,12 @@ static int broken_state_count_compare(const void **a_ptr, const void **b_ptr) { const broken_state_count_t *a = *a_ptr, *b = *b_ptr; - return b->count - a->count; + if (b->count < a->count) + return -1; + else if (b->count == a->count) + return 0; + else + return 1; } /** Upper limit on the number of different states to report for connection