Ensure multiplication proceeds division in case OS_TICKS_PER_SEC<1000
@@ -194,7 +194,7 @@ os_time_ms_to_ticks(uint32_t ms, uint32_t *out_ticks)
_Static_assert(OS_TICKS_PER_SEC <= UINT32_MAX,
"OS_TICKS_PER_SEC must be <= UINT32_MAX");
- ticks = (uint64_t)ms * OS_TICKS_PER_SEC / 1000;
+ ticks = ((uint64_t)ms * OS_TICKS_PER_SEC) / 1000;
if (ticks > UINT32_MAX) {
return OS_EINVAL;
}
