mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Relax handling of bad numeric values in the DOM parser.
string_to_gnc_numeric returns a nullptr if the GncNumeric string constructor decides that the denominator is 0. The 2.6 version of the function didn't check for this and occasionally stored error values. Convert that to gnc_numeric_zero to allow the file to be processed.
This commit is contained in:
parent
72f95238fb
commit
b8fc9df87b
@ -517,23 +517,15 @@ gnc_numeric*
|
||||
dom_tree_to_gnc_numeric (xmlNodePtr node)
|
||||
{
|
||||
gchar* content = dom_tree_to_text (node);
|
||||
gnc_numeric* ret;
|
||||
if (!content)
|
||||
return NULL;
|
||||
|
||||
ret = g_new (gnc_numeric, 1);
|
||||
gnc_numeric *ret = g_new (gnc_numeric, 1);
|
||||
|
||||
if (string_to_gnc_numeric (content, ret))
|
||||
{
|
||||
g_free (content);
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_free (content);
|
||||
g_free (ret);
|
||||
return NULL;
|
||||
}
|
||||
if (!string_to_gnc_numeric (content, ret))
|
||||
*ret = gnc_numeric_zero ();
|
||||
g_free (content);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline Timespec
|
||||
|
Loading…
Reference in New Issue
Block a user