From cc82b6c64d3f9f1602c35548dc96a6b219aea86d Mon Sep 17 00:00:00 2001 From: Arjen Baart Date: Wed, 29 Dec 2010 14:10:42 +0100 Subject: [PATCH] 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. --- account.cpp | 1 + account.h | 1 + 2 files changed, 2 insertions(+) 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; } -- 2.11.0