From 146086332b7c3dd598d8c5516485452fad79eb21 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Wed, 5 Jul 2023 12:53:26 +0200 Subject: [PATCH] Fix overflow in event expiration days --- src/ui/EventExpiry.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ui/EventExpiry.cpp b/src/ui/EventExpiry.cpp index ca149dc3..ef3f0933 100644 --- a/src/ui/EventExpiry.cpp +++ b/src/ui/EventExpiry.cpp @@ -90,7 +90,7 @@ void EventExpiry::setExpireEventsAfterDays(int val) { if (val > 0) - this->event.expire_after_ms = val * (1000 * 60 * 60 * 24); + this->event.expire_after_ms = std::uint64_t(val) * (1000 * 60 * 60 * 24); else this->event.expire_after_ms = 0; emit expireEventsAfterDaysChanged(); @@ -100,7 +100,7 @@ void EventExpiry::setProtectLatestEvents(int val) { if (val > 0) - this->event.protect_latest = val; + this->event.protect_latest = std::uint64_t(val); else this->event.expire_after_ms = 0; emit protectLatestEventsChanged(); @@ -110,7 +110,7 @@ void EventExpiry::setExpireEventsAfterCount(int val) { if (val > 0) - this->event.keep_only_latest = val; + this->event.keep_only_latest = std::uint64_t(val); else this->event.keep_only_latest = 0; emit expireEventsAfterCountChanged();