X-Git-Url: https://git.xinqibao.xyz/slstatus.git/blobdiff_plain/16e15217c6cb56bd4125c54e645b932a50655b9d..96ddf4e1dee808d6ae8162fc1a13126a3d4c77dc:/components/uptime.c?ds=inline

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 <inttypes.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <time.h>
 
@@ -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);
 }