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.
This commit is contained in:
Nick Mathewson 2018-04-17 11:09:55 -04:00
parent 002c5ca5d1
commit 2bf6f1cd39
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}