mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
bug fixes from rob browning
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@841 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
918bf778d4
commit
24059fd35f
@ -421,11 +421,12 @@ xaccCheckDateOrder (Account * acc, Split *split )
|
||||
{
|
||||
int outOfOrder = 0;
|
||||
Split *s;
|
||||
Split *prevSplit;
|
||||
Split *nextSplit;
|
||||
Split *prevSplit = NULL;
|
||||
Split *nextSplit = NULL;
|
||||
int position;
|
||||
|
||||
if (NULL == acc) return 0;
|
||||
if (NULL == split) return 0;
|
||||
|
||||
/* find the split's location in the array */
|
||||
position = 0;
|
||||
@ -438,12 +439,15 @@ xaccCheckDateOrder (Account * acc, Split *split )
|
||||
|
||||
if (!s) {
|
||||
printf ("Internal Error: xaccCheckDateOrder(): ");
|
||||
printf (" split not present in account \n");
|
||||
printf (" split %s not present in account \n", split);
|
||||
return 0;
|
||||
}
|
||||
|
||||
prevSplit = acc->splits [position-1];
|
||||
nextSplit = acc->splits [position+1];
|
||||
/* if zeroth split, then there is no previous */
|
||||
if (0 < position) prevSplit = acc->splits [position-1];
|
||||
|
||||
/* if last split, OK, since array is null terminated, and last+1 is null */
|
||||
nextSplit = acc->splits [position+1];
|
||||
|
||||
/* figure out if the transactions are out of order */
|
||||
if (NULL != prevSplit) {
|
||||
|
Loading…
Reference in New Issue
Block a user