Bugs (?) in gnc-pricedb.c

Andrew Sackville-West andrew at farwestbilliards.com
Sun Feb 19 17:01:01 EST 2006


On Wed, 08 Feb 2006 02:50:47 -0500
Mike Alexander <mta at umich.edu> wrote:

> While looking for another problem I found what look like bugs in a 
> couple of functions [1] in gnc-pricedb.c.  It appears to me that the 
> loop termination test is backwards in a couple of places.  I've 
> attached a patch that fixes this (if it is indeed a problem).
> 
> I added a number of patches to bug reports, but since I don't know how 
> to cause this bug to occur I didn't create a bug report for it.
> 
> [1] gnc_pricedb_convert_balance_latest_price and 
> gnc_pricedb_convert_balance_nearest_price.

Hampton, 

I see other problems with these functions...
for ex: if (!price-list) { balance = gnc_numeric_zero; return balance;};

well, that just doens't make sense. just because there is no price-list
we return a 0 for the balance? granted the function has pricedb in the
name and so its reasonable to assume there is a pricelist, but how do
you distinguish between a no price-list situation and a balance that is
actually zero? 

more freaking reading!

A

> 
> -- 
> Mike Alexander           mta at umich.edu
> Ann Arbor, MI            PGP key ID: BEA343A6
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20060219/3a607f58/attachment.bin


More information about the gnucash-devel mailing list