aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-09-03 06:44:54 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-09-03 06:44:54 +0200
commiteafb8a33bc05f5c435429306297dc65f49e3bfd2 (patch)
tree36d2a66cf07296baef0eb9fb51b45bb80e2b5f5f
parentf3e4f20d0b5806795763cc89cfd3cde3d897c0a6 (diff)
downloadglutte-o-matic-eafb8a33bc05f5c435429306297dc65f49e3bfd2.tar.gz
glutte-o-matic-eafb8a33bc05f5c435429306297dc65f49e3bfd2.tar.bz2
glutte-o-matic-eafb8a33bc05f5c435429306297dc65f49e3bfd2.zip
Fix uptime calculation after 25days
-rw-r--r--src/common/Core/stats.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/Core/stats.c b/src/common/Core/stats.c
index cb71d82..63aa6fa 100644
--- a/src/common/Core/stats.c
+++ b/src/common/Core/stats.c
@@ -219,17 +219,17 @@ const char* stats_build_text(void)
}
uint64_t uptime = timestamp_now();
- int uptime_j = uptime / (24 * 3600 * 1000);
+ uint64_t uptime_j = uptime / (24 * 3600 * 1000);
uptime -= uptime_j * (24 * 3600 * 1000);
- int uptime_h = uptime / (3600 * 1000);
+ uint64_t uptime_h = uptime / (3600 * 1000);
uptime -= uptime_h * (3600 * 1000);
- int uptime_m = uptime / (60 * 1000);
+ uint64_t uptime_m = uptime / (60 * 1000);
stats_end_ix += snprintf(stats_text + stats_end_ix, STATS_LEN - 1 - stats_end_ix,
"Version= %s\n"
"Uptime= %dj%dh%dm\n",
vc_get_version(),
- uptime_j, uptime_h, uptime_m);
+ (int)uptime_j, (int)uptime_h, (int)uptime_m);
if (values_valid == 0) {
return stats_text;