From 3745f83a7b74a6d5becacc9c684c2fc354894aa1 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 1 Nov 2015 22:05:11 -0500 Subject: [PATCH] CmdCalendar: Converted from strtol to std::stoul/stoi --- src/commands/CmdCalendar.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands/CmdCalendar.cpp b/src/commands/CmdCalendar.cpp index b45712f95..b7f956288 100644 --- a/src/commands/CmdCalendar.cpp +++ b/src/commands/CmdCalendar.cpp @@ -127,12 +127,12 @@ int CmdCalendar::execute (std::string& output) // YYYY. else if (Lexer::isAllDigits (arg) && arg.length () == 4) - argYear = strtol (arg.c_str (), NULL, 10); + argYear = std::stoi (arg); // MM. else if (Lexer::isAllDigits (arg) && arg.length () <= 2) { - argMonth = strtol (arg.c_str (), NULL, 10); + argMonth = std::stoi (arg); if (argMonth < 1 || argMonth > 12) throw format (STRING_CMD_CAL_BAD_MONTH, arg); } @@ -569,7 +569,7 @@ std::string CmdCalendar::renderMonths ( task.has ("due")) { std::string due = task.get ("due"); - ISO8601d duedmy (strtol (due.c_str(), NULL, 10)); + ISO8601d duedmy (static_cast (std::stoul (due))); if (duedmy.day () == d && duedmy.month () == months[mpl] &&