Bug fixes in Ledger::read()
authorArjen Baart <arjen@andromeda.nl>
Wed, 29 Dec 2010 13:10:42 +0000 (14:10 +0100)
committerArjen Baart <arjen@andromeda.nl>
Wed, 29 Dec 2010 13:10:42 +0000 (14:10 +0100)
Member companyname was not initialized in the constructor.
An attempt was made to read beyond the end of the Ledger file.

account.cpp
account.h

index 39e9031..1ccb4f8 100644 (file)
@@ -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))
       {
index 133c82a..cebb5ff 100644 (file)
--- a/account.h
+++ b/account.h
@@ -309,6 +309,7 @@ public:
 
    Ledger()
    {
+      companyname = "";
       nr_accs = 0;
    }