diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-01-25 17:27:25 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-01-26 11:05:21 -0500 |
commit | 9a4b2ec764de7ff49931a4ea561febada728d9b3 (patch) | |
tree | 726493926f394689e167d1f5b246d82186d189a1 /src/or/circuitbuild.c | |
parent | 7a446e6754b21eae1b0cfe3b0cf737ac2be964a9 (diff) | |
download | tor-9a4b2ec764de7ff49931a4ea561febada728d9b3.tar.gz tor-9a4b2ec764de7ff49931a4ea561febada728d9b3.zip |
Avoid sketchy integer cast in cbt code
When calling circuit_build_times_shuffle_and_store_array, we were
passing a uint32_t as an int. arma is pretty sure that this can't
actually cause a bug, because of checks elsewhere in the code, but
it's best not to pass a uint32_t as an int anyway.
Found by doorss; fix on 0.2.2.4-alpha.
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r-- | src/or/circuitbuild.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 3788959556..5c9c1acf25 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -588,9 +588,9 @@ circuit_build_times_update_state(circuit_build_times_t *cbt, static void circuit_build_times_shuffle_and_store_array(circuit_build_times_t *cbt, build_time_t *raw_times, - int num_times) + uint32_t num_times) { - int n = num_times; + uint32_t n = num_times; if (num_times > CBT_NCIRCUITS_TO_OBSERVE) { log_notice(LD_CIRC, "Decreasing circuit_build_times size from %d to %d", num_times, CBT_NCIRCUITS_TO_OBSERVE); |