Fix issues with year 2038 (#3052)
* Fix annotations in year 2038 Fixes #3050 * Ensure 32-bit systems work better after 2038 Without this patch, their 32-bit signed long int could overflow. This patch was done while working on reproducible builds for openSUSE.
This commit is contained in:
committed by
GitHub
parent
7017d8fc31
commit
603bf075f1
@@ -109,13 +109,13 @@ int CmdStats::execute (std::string& output)
|
||||
if (task.is_blocked) ++blockedT;
|
||||
if (task.is_blocking) ++blockingT;
|
||||
|
||||
time_t entry = strtol (task.get ("entry").c_str (), nullptr, 10);
|
||||
time_t entry = strtoll (task.get ("entry").c_str (), nullptr, 10);
|
||||
if (entry < earliest) earliest = entry;
|
||||
if (entry > latest) latest = entry;
|
||||
|
||||
if (status == Task::completed)
|
||||
{
|
||||
time_t end = strtol (task.get ("end").c_str (), nullptr, 10);
|
||||
time_t end = strtoll (task.get ("end").c_str (), nullptr, 10);
|
||||
daysPending += (end - entry) / 86400.0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user