[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] [tor/master 4/4] Add a note about _compare_int not doing overflow right
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Mon, 3 Jan 2011 12:03:21 -0500
Subject: Add a note about _compare_int not doing overflow right
Commit: 93a6d53ef33f61a711c7a5b0583dae88a160d730
---
src/or/rephist.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/or/rephist.c b/src/or/rephist.c
index 451db69..3146d70 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -1982,7 +1982,9 @@ rep_hist_exit_stats_term(void)
tor_free(exit_streams);
}
-/** Helper for qsort: compare two ints. */
+/** Helper for qsort: compare two ints. Does not handle overflow properly,
+ * but works fine for sorting an array of port numbers, which is what we use
+ * it for. */
static int
_compare_int(const void *x, const void *y)
{
--
1.7.1