We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3a0ab72 commit 771b4bfCopy full SHA for 771b4bf
src/ksf/comp/ksMqttConnector.cpp
@@ -286,6 +286,9 @@ namespace ksf::comps
286
287
uint32_t ksMqttConnector::getConnectionTimeSeconds() const
288
{
289
- return isConnected() ? ((ksf::millis64() - lastSuccessConnectionTime) / KSF_ONE_SEC_MS) : 0;
+ if (!isConnected())
290
+ return 0;
291
+
292
+ return static_cast<uint32_t>((ksf::millis64() - lastSuccessConnectionTime) / static_cast<uint64_t>(KSF_ONE_SEC_MS));
293
}
294
src/ksf/ksConstants.cpp
@@ -240,7 +240,7 @@ namespace ksf
240
241
const std::string getUptimeString()
242
243
- auto uptime{millis64()/1000};
+ auto uptime{millis64() / static_cast<uint64_t>(KSF_ONE_SEC_MS)};
244
return getUptimeFromSeconds(uptime);
245
246
0 commit comments