X-Git-Url: https://git.xinqibao.xyz/slstatus.git/blobdiff_plain/16e15217c6cb56bd4125c54e645b932a50655b9d..e213b48122f1f8e8d837053324d9c891a67a38d2:/components/uptime.c diff --git a/components/uptime.c b/components/uptime.c index f957f17..978f88f 100644 --- a/components/uptime.c +++ b/components/uptime.c @@ -1,5 +1,5 @@ /* See LICENSE file for copyright and license details. */ -#include +#include #include #include @@ -8,7 +8,7 @@ const char * uptime(void) { - uint64_t h, m; + uintmax_t h, m; struct timespec uptime; if (clock_gettime(CLOCK_BOOTTIME, &uptime) < 0) { @@ -19,5 +19,5 @@ uptime(void) h = uptime.tv_sec / 3600; m = uptime.tv_sec % 3600 / 60; - return bprintf("%" PRIu64 "h %" PRIu64 "m", h, m); + return bprintf("%juh %jum", h, m); }