mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Recurrence: Converted from strtol to std::stoi
This commit is contained in:
parent
8db04b8ec1
commit
368df43583
1 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue