diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-04-17 11:09:55 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-04-17 11:09:55 -0400 |
commit | 2bf6f1cd39c102749ee518664036c90ab1dbfc9c (patch) | |
tree | 3e578bb22886c878e7278347d0c33b2dab37d33a /src/common | |
parent | 002c5ca5d1986a0fad0c961113e512d47c2edfe0 (diff) | |
download | tor-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.c | 2 |
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; } |