mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
ISO8601: Removed cowardly segfault fix
This commit is contained in:
parent
78b8fc5dc7
commit
d8c5927362
1 changed files with 2 additions and 6 deletions
|
@ -1085,15 +1085,11 @@ void ISO8601d::toMDY (int& m, int& d, int& y) const
|
|||
const std::string ISO8601d::toString (
|
||||
const std::string& format /*= "m/d/Y" */) const
|
||||
{
|
||||
// Making this local copy seems to fix a bug. Remove the local copy and
|
||||
// you'll see segmentation faults and all kinds of gibberish.
|
||||
std::string localFormat = format;
|
||||
|
||||
char buffer[12];
|
||||
std::string formatted;
|
||||
for (unsigned int i = 0; i < localFormat.length (); ++i)
|
||||
for (unsigned int i = 0; i < format.length (); ++i)
|
||||
{
|
||||
int c = localFormat[i];
|
||||
int c = format[i];
|
||||
switch (c)
|
||||
{
|
||||
case 'm': sprintf (buffer, "%d", this->month ()); break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue