[tor-commits] [tor/master] Avoid warning in broken_state_count_compare

nickm at torproject.org nickm at torproject.org
Tue Jul 12 15:23:35 UTC 2011


commit 9a6642f6f5681fe92b17b87304126d2a3b2dec02
Author: Nick Mathewson <nickm at torproject.org>
Date:   Tue Jul 12 11:23:55 2011 -0400

    Avoid warning in broken_state_count_compare
---
 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 94f8e22..2871f1f 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



More information about the tor-commits mailing list