From 78c44b5e795a98baacfbc56943b784370956cbca Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 15 Aug 2004 02:50:07 -0400 Subject: bug fix --- ledger.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ledger.cc b/ledger.cc index 3a58fce5..abfaca3c 100644 --- a/ledger.cc +++ b/ledger.cc @@ -111,7 +111,7 @@ entry_t * journal_t::derive_entry(strings_list::iterator i, - first->amount, - first->amount); added->add_transaction(xact); - if (std::string(*i++) == "-from" && i != end) + if (i != end && std::string(*i++) == "-from" && i != end) if (account_t * acct = find_account(*i)) added->transactions.back()->account = acct; } else { @@ -157,7 +157,7 @@ entry_t * journal_t::derive_entry(strings_list::iterator i, added->add_transaction(xact); } - if (std::string(*i++) == "-from" && i != end) { + if (i != end && std::string(*i++) == "-from" && i != end) { if (account_t * acct = find_account(*i++)) { transaction_t * xact = new transaction_t(NULL, acct); added->add_transaction(xact); -- cgit v1.2.3