From 8b3f8d188444510d8ca00e5db90bac0cf5663c91 Mon Sep 17 00:00:00 2001 From: thdox Date: Sat, 17 May 2014 23:41:07 +0200 Subject: Fix bug introduced by commit AA2FF2B Correction is to not use uninitialized amount --- src/textual.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/textual.cc') diff --git a/src/textual.cc b/src/textual.cc index 8d4db512..418b6c00 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -1638,24 +1638,23 @@ post_t * instance_t::parse_post(char * line, "line " << context.linenum << ": " << "post amount = " << amt); amount_t diff = amt; - amount_t tot; switch (account_total.type()) { case value_t::AMOUNT: - tot = account_total.as_amount(); + diff -= account_total.as_amount(); break; case value_t::BALANCE: if (optional comm_bal = account_total.as_balance().commodity_amount(amt.commodity())) - tot = *comm_bal; + diff -= *comm_bal; break; default: break; } - diff -= tot; + amount_t tot = amt - diff; DEBUG("post.assign", "line " << context.linenum << ": " << "diff = " << diff); -- cgit v1.2.3