r23740 - gnucash/trunk/src/register/ledger-core - Bug 722123 - Zero price entry added to price database on stock purchase

Herbert Thoma herbert.thoma at iis.fraunhofer.de
Wed Jan 22 10:07:27 EST 2014


Hi!

This gives me a "may be used ininitialized" warning.
Can be fixed by initializing PriceCell *cell with NULL
(first line of function gnc_split_register_auto_calc()),
see below.

  Herbert.


diff --git a/src/register/ledger-core/split-register.c b/src/register/ledger-core/split-register.c
index 5055994..d126297 100644
--- a/src/register/ledger-core/split-register.c
+++ b/src/register/ledger-core/split-register.c
@@ -2076,7 +2076,7 @@ record_price (SplitRegister *reg, Account *account, gnc_numeric value)
  static gboolean
  gnc_split_register_auto_calc (SplitRegister *reg, Split *split)
  {
-    PriceCell *cell;
+    PriceCell *cell = NULL;
      gboolean recalc_shares = FALSE;
      gboolean recalc_price = FALSE;
      gboolean recalc_value = FALSE;


Am 22.01.2014 02:53, schrieb John Ralls:
> Author: jralls
> Date: 2014-01-21 20:53:02 -0500 (Tue, 21 Jan 2014)
> New Revision: 23740
> Trac: http://svn.gnucash.org/trac/changeset/23740
>
> Modified:
>     gnucash/trunk/src/register/ledger-core/split-register.c
> Log:
> Bug 722123 - Zero price entry added to price database on stock purchase
>
> Just needed to get the new price back from the cell after it was
> calculated.
>
> _______________________________________________
> gnucash-patches mailing list
> gnucash-patches at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-patches
>


More information about the gnucash-devel mailing list