diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-07-12 11:23:55 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-07-12 11:23:55 -0400 |
commit | 9a6642f6f5681fe92b17b87304126d2a3b2dec02 (patch) | |
tree | 443b53589c6b3bb7a6bf62b5f6e448550f7179b4 | |
parent | 597da4989e6f6a9c1a12ad3197dd6532b1a80035 (diff) | |
download | tor-9a6642f6f5681fe92b17b87304126d2a3b2dec02.tar.gz tor-9a6642f6f5681fe92b17b87304126d2a3b2dec02.zip |
Avoid warning in broken_state_count_compare
-rw-r--r-- | src/or/connection_or.c | 7 |
1 files changed, 6 insertions, 1 deletions
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 |