Skip to content

Commit f370f9b

Browse files
committed
fix: cast ULL constant arithmetic to uint64 for PRIu64 format
ONE_MIN and ONE_HOUR derive from 1000ULL, producing unsigned long long. Cast the result of arithmetic with these constants to (uint64) to match the PRIu64 format specifier on platforms where uint64_t is unsigned long.
1 parent 3d31950 commit f370f9b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/util/util.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -834,10 +834,10 @@ print_latency(mtime_t latency)
834834
uint64 hour = latency / ONE_HOUR;
835835
return safe_asprintf("%" PRIu64 " hour%s %" PRIu64 " min",
836836
hour, hour > 1 ? "s" : "",
837-
(latency % ONE_HOUR) / ONE_MIN);
837+
(uint64)((latency % ONE_HOUR) / ONE_MIN));
838838
} else if (latency > ONE_MIN) {
839839
return safe_asprintf("%" PRIu64 " min %.1f sec",
840-
latency / ONE_MIN,
840+
(uint64)(latency / ONE_MIN),
841841
(latency % ONE_MIN) / (ONE_SEC * 1.0));
842842
} else if (latency > ONE_SEC) {
843843
return safe_asprintf("%.1f sec", latency / (ONE_SEC * 1.0));

0 commit comments

Comments
 (0)