Revert "Recurrence: Converted from sprintf to std::to_string"

This reverts commit b4035d6ff5.
This commit is contained in:
Paul Beckingham 2015-11-02 18:46:19 -05:00
parent def0223afa
commit 2c0bb1663d

View file

@ -97,14 +97,18 @@ void handleRecurrence ()
rec.set ("uuid", uuid ()); // New UUID.
rec.set ("parent", t.get ("uuid")); // Remember mom.
rec.setAsNow ("entry"); // New entry date.
rec.set ("due", std::to_string (d.toEpoch ()));
char dueDate[16];
sprintf (dueDate, "%u", (unsigned int) d.toEpoch ());
rec.set ("due", dueDate); // Store generated due date.
if (t.has ("wait"))
{
ISO8601d old_wait (t.get_date ("wait"));
ISO8601d old_due (t.get_date ("due"));
ISO8601d due (d);
rec.set ("wait", std::to_string ((due + (old_wait - old_due)).toEpoch ()));
sprintf (dueDate, "%u", (unsigned int) (due + (old_wait - old_due)).toEpoch ());
rec.set ("wait", dueDate);
rec.setStatus (Task::waiting);
mask += 'W';
}
@ -114,7 +118,10 @@ void handleRecurrence ()
rec.setStatus (Task::pending);
}
rec.set ("imask", i);
char indexMask[12];
sprintf (indexMask, "%u", (unsigned int) i);
rec.set ("imask", indexMask); // Store index into mask.
rec.remove ("mask"); // Remove the mask of the parent.
// Add the new task to the DB.