mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Clear the GDate before use.
If the transaction doesn't have the gdate-posted slot and the random junk left on the stack where date lives happens to make a valid gdate then timespec_to_gdate won't be called and a bogus date will be returned.
This commit is contained in:
parent
51e29e7836
commit
a1b574af4f
@ -2248,6 +2248,7 @@ GDate
|
||||
xaccTransGetDatePostedGDate (const Transaction *trans)
|
||||
{
|
||||
GDate result;
|
||||
g_date_clear (&result, 1);
|
||||
if (trans)
|
||||
{
|
||||
/* Can we look up this value in the kvp slot? If yes, use it
|
||||
@ -2260,10 +2261,6 @@ xaccTransGetDatePostedGDate (const Transaction *trans)
|
||||
else
|
||||
result = timespec_to_gdate(xaccTransRetDatePostedTS(trans));
|
||||
}
|
||||
else
|
||||
{
|
||||
g_date_clear(&result, 1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user