commit 2bf6f1cd39c102749ee518664036c90ab1dbfc9c
parent 002c5ca5d1986a0fad0c961113e512d47c2edfe0
Author: Nick Mathewson <nickm@torproject.org>
Date: Tue, 17 Apr 2018 11:09:55 -0400
token bucket: Add parens to rate_per_sec_to_rate_per_step()
Typecasts bind more tightly than division, so we need to do the
division first.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/common/token_bucket.c b/src/common/token_bucket.c
@@ -119,7 +119,7 @@ rate_per_sec_to_rate_per_step(uint32_t rate)
*/
uint64_t units = (uint64_t) rate * TICKS_PER_STEP;
uint32_t val = (uint32_t)
- monotime_coarse_stamp_units_to_approx_msec(units) / 1000;
+ (monotime_coarse_stamp_units_to_approx_msec(units) / 1000);
return val ? val : 1;
}