From 368df43583180ee15b92d747f89b084cee135207 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 1 Nov 2015 21:54:29 -0500 Subject: [PATCH] Recurrence: Converted from strtol to std::stoi --- src/recur.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/recur.cpp b/src/recur.cpp index a27b36de9..37b06b5d0 100644 --- a/src/recur.cpp +++ b/src/recur.cpp @@ -240,7 +240,7 @@ ISO8601d getNextRecurrence (ISO8601d& current, std::string& period) else if (Lexer::isDigit (period[0]) && period[period.length () - 1] == 'm') { - int increment = strtol (period.substr (0, period.length () - 1).c_str (), NULL, 10); + int increment = std::stoi (period.substr (0, period.length () - 1)); m += increment; while (m > 12) @@ -259,7 +259,7 @@ ISO8601d getNextRecurrence (ISO8601d& current, std::string& period) Lexer::isAllDigits (period.substr (1, period.length () - 2)) && period[period.length () - 1] == 'M') { - int increment = strtol (period.substr (0, period.length () - 1).c_str (), NULL, 10); + int increment = std::stoi (period.substr (0, period.length () - 1)); m += increment; while (m > 12) @@ -292,7 +292,7 @@ ISO8601d getNextRecurrence (ISO8601d& current, std::string& period) else if (Lexer::isDigit (period[0]) && period[period.length () - 1] == 'q') { - int increment = strtol (period.substr (0, period.length () - 1).c_str (), NULL, 10); + int increment = std::stoi (period.substr (0, period.length () - 1)); m += 3 * increment; while (m > 12) @@ -384,7 +384,7 @@ void updateRecurrenceMask (Task& task) if (uuid != "" && context.tdb2.get (uuid, parent)) { - unsigned int index = strtol (task.get ("imask").c_str (), NULL, 10); + unsigned int index = std::stoi (task.get ("imask")); std::string mask = parent.get ("mask"); if (mask.length () > index) {