summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-04-17 11:09:55 -0400
committerNick Mathewson <nickm@torproject.org>2018-04-17 11:09:55 -0400
commit2bf6f1cd39c102749ee518664036c90ab1dbfc9c (patch)
tree3e578bb22886c878e7278347d0c33b2dab37d33a /src/common
parent002c5ca5d1986a0fad0c961113e512d47c2edfe0 (diff)
downloadtor-2bf6f1cd39c102749ee518664036c90ab1dbfc9c.tar.gz
tor-2bf6f1cd39c102749ee518664036c90ab1dbfc9c.zip
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 (limited to 'src/common')
-rw-r--r--src/common/token_bucket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/token_bucket.c b/src/common/token_bucket.c
index d18731b0e3..747189e751 100644
--- 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;
}