diff --git a/src/commands/CmdReports.cpp b/src/commands/CmdReports.cpp index f6a70d2e0..2901a02df 100644 --- a/src/commands/CmdReports.cpp +++ b/src/commands/CmdReports.cpp @@ -26,6 +26,7 @@ //////////////////////////////////////////////////////////////////////////////// #include +#include #include #include #include diff --git a/src/commands/CmdSummary.cpp b/src/commands/CmdSummary.cpp index 6cffa6add..87a9c2002 100644 --- a/src/commands/CmdSummary.cpp +++ b/src/commands/CmdSummary.cpp @@ -26,6 +26,7 @@ //////////////////////////////////////////////////////////////////////////////// #include +#include #include #include #include @@ -96,7 +97,7 @@ int CmdSummary::execute (const std::string&, std::string& output) { ++countPending[project]; - time_t entry = atoi (task->get ("entry").c_str ()); + time_t entry = strtol (task->get ("entry").c_str (), NULL, 10); if (entry) sumEntry[project] = sumEntry[project] + (double) (now - entry); } @@ -105,8 +106,8 @@ int CmdSummary::execute (const std::string&, std::string& output) { ++countCompleted[project]; - time_t entry = atoi (task->get ("entry").c_str ()); - time_t end = atoi (task->get ("end").c_str ()); + time_t entry = strtol (task->get ("entry").c_str (), NULL, 10); + time_t end = strtol (task->get ("end").c_str (), NULL, 10); if (entry && end) sumEntry[project] = sumEntry[project] + (double) (end - entry); } diff --git a/src/commands/CmdTimesheet.cpp b/src/commands/CmdTimesheet.cpp index 52b7efc95..a6fcc3722 100644 --- a/src/commands/CmdTimesheet.cpp +++ b/src/commands/CmdTimesheet.cpp @@ -26,6 +26,7 @@ //////////////////////////////////////////////////////////////////////////////// #include +#include #include #include #include @@ -109,7 +110,7 @@ int CmdTimesheet::execute (const std::string&, std::string& output) // If task completed within range. if (task->getStatus () == Task::completed) { - Date compDate (atoi (task->get ("end").c_str ())); + Date compDate (strtol (task->get ("end").c_str (), NULL, 10)); if (compDate >= start && compDate < end) { Color c (task->get ("fg") + " " + task->get ("bg")); @@ -147,7 +148,7 @@ int CmdTimesheet::execute (const std::string&, std::string& output) if (task->getStatus () == Task::pending && task->has ("start")) { - Date startDate (atoi (task->get ("start").c_str ())); + Date startDate (strtol (task->get ("start").c_str (), NULL, 10)); if (startDate >= start && startDate < end) { Color c (task->get ("fg") + " " + task->get ("bg"));