From 617e0ebe54cd20edafb0719d7e14b0d9f37f5569 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Thu, 2 Jun 2011 23:14:34 -0400 Subject: [PATCH] Build - Migrated atoi to strtol, and added missing include. --- src/commands/CmdCalendar.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/commands/CmdCalendar.cpp b/src/commands/CmdCalendar.cpp index db132defc..b9971f3e7 100644 --- a/src/commands/CmdCalendar.cpp +++ b/src/commands/CmdCalendar.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -130,12 +131,12 @@ int CmdCalendar::execute (const std::string&, std::string& output) // YYYY. else if (digitsOnly (*arg) && arg->length () == 4) - argYear = atoi (arg->c_str ()); + argYear = strtol (arg->c_str (), NULL, 10); // MM. else if (digitsOnly (*arg) && arg->length () <= 2) { - argMonth = atoi (arg->c_str ()); + argMonth = strtol (arg->c_str (), NULL, 10); if (argMonth < 1 || argMonth > 12) throw std::string ("Argument '") + *arg + "' is not a valid month."; } @@ -189,7 +190,7 @@ int CmdCalendar::execute (const std::string&, std::string& output) !task->hasTag ("nocal")) { ++countDueDates; - Date d (atoi (task->get ("due").c_str ())); + Date d (strtol (task->get ("due").c_str (), NULL, 10)); if (d < oldest) oldest = d; } } @@ -556,7 +557,7 @@ std::string CmdCalendar::renderMonths ( task->has ("due")) { std::string due = task->get ("due"); - Date duedmy (atoi(due.c_str())); + Date duedmy (strtol (due.c_str(), NULL, 10)); if (duedmy.day () == d && duedmy.month () == months[mpl] &&