ccollins476ad closed pull request #999: os_time: Prevent 0 ticks returned when 

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/kernel/os/src/os_time.c b/kernel/os/src/os_time.c
index df0d67844..31bb478a4 100644
--- a/kernel/os/src/os_time.c
+++ b/kernel/os/src/os_time.c
@@ -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;


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

Reply via email to