From: Arjen Baart Date: Wed, 29 Dec 2010 13:10:42 +0000 (+0100) Subject: Bug fixes in Ledger::read() X-Git-Url: http://www.andromeda.nl/gitweb/?p=account.git;a=commitdiff_plain;h=cc82b6c64d3f9f1602c35548dc96a6b219aea86d Bug fixes in Ledger::read() Member companyname was not initialized in the constructor. An attempt was made to read beyond the end of the Ledger file. --- diff --git a/account.cpp b/account.cpp index 39e9031..1ccb4f8 100644 --- a/account.cpp +++ b/account.cpp @@ -601,6 +601,7 @@ void Ledger::read(char *filename) nr_accs = 0; while (in) { + line_begin = '\n'; in.get(line_begin); if (isdigit(line_begin)) { diff --git a/account.h b/account.h index 133c82a..cebb5ff 100644 --- a/account.h +++ b/account.h @@ -309,6 +309,7 @@ public: Ledger() { + companyname = ""; nr_accs = 0; }