CmdCalendar: Converted from strtol to std::stoul/stoi
This commit is contained in:
@@ -127,12 +127,12 @@ int CmdCalendar::execute (std::string& output)
|
|||||||
|
|
||||||
// YYYY.
|
// YYYY.
|
||||||
else if (Lexer::isAllDigits (arg) && arg.length () == 4)
|
else if (Lexer::isAllDigits (arg) && arg.length () == 4)
|
||||||
argYear = strtol (arg.c_str (), NULL, 10);
|
argYear = std::stoi (arg);
|
||||||
|
|
||||||
// MM.
|
// MM.
|
||||||
else if (Lexer::isAllDigits (arg) && arg.length () <= 2)
|
else if (Lexer::isAllDigits (arg) && arg.length () <= 2)
|
||||||
{
|
{
|
||||||
argMonth = strtol (arg.c_str (), NULL, 10);
|
argMonth = std::stoi (arg);
|
||||||
if (argMonth < 1 || argMonth > 12)
|
if (argMonth < 1 || argMonth > 12)
|
||||||
throw format (STRING_CMD_CAL_BAD_MONTH, arg);
|
throw format (STRING_CMD_CAL_BAD_MONTH, arg);
|
||||||
}
|
}
|
||||||
@@ -569,7 +569,7 @@ std::string CmdCalendar::renderMonths (
|
|||||||
task.has ("due"))
|
task.has ("due"))
|
||||||
{
|
{
|
||||||
std::string due = task.get ("due");
|
std::string due = task.get ("due");
|
||||||
ISO8601d duedmy (strtol (due.c_str(), NULL, 10));
|
ISO8601d duedmy (static_cast <time_t> (std::stoul (due)));
|
||||||
|
|
||||||
if (duedmy.day () == d &&
|
if (duedmy.day () == d &&
|
||||||
duedmy.month () == months[mpl] &&
|
duedmy.month () == months[mpl] &&
|
||||||
|
|||||||
Reference in New Issue
Block a user