projects
/
account.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0eacf91
)
Bug fixes in Ledger::read()
author
Arjen Baart
<arjen@andromeda.nl>
Wed, 29 Dec 2010 13:10:42 +0000
(14:10 +0100)
committer
Arjen 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
patch
|
blob
|
history
account.h
patch
|
blob
|
history
diff --git
a/account.cpp
b/account.cpp
index
39e9031
..
1ccb4f8
100644
(file)
--- 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
(file)
--- a/
account.h
+++ b/
account.h
@@
-309,6
+309,7
@@
public:
Ledger()
{
+ companyname = "";
nr_accs = 0;
}