mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 795377 - Reads and saves Gnucash 2.6.19 XML file, then can't reread it, due to bad date in old file
This commit contains another round of cleanups in the timespec to time64 conversion. There were a number of false assumptions that time64 = 0 would be a bad date in the xml parser. This commit corrects enough of them to eliminate the bug. Further cleanup is probably advised but can be done at a later stage.
This commit is contained in:
@@ -1202,7 +1202,7 @@ time64
|
||||
gnc_iso8601_to_time64_gmt(const char *cstr)
|
||||
{
|
||||
time64 time;
|
||||
if (!cstr) return 0;
|
||||
if (!cstr) return INT64_MAX;
|
||||
try
|
||||
{
|
||||
GncDateTime gncdt(cstr);
|
||||
@@ -1211,12 +1211,12 @@ gnc_iso8601_to_time64_gmt(const char *cstr)
|
||||
catch(std::logic_error& err)
|
||||
{
|
||||
PWARN("Error processing %s: %s", cstr, err.what());
|
||||
return 0;
|
||||
return INT64_MAX;
|
||||
}
|
||||
catch(std::runtime_error& err)
|
||||
{
|
||||
PWARN("Error processing time64 %s: %s", cstr, err.what());
|
||||
return 0;
|
||||
return INT64_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user