summaryrefslogtreecommitdiff
path: root/amount.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-09-26 23:48:31 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-09-26 23:48:31 -0400
commitf8a62c444f070b5e7f1ed00a2a322d01da729775 (patch)
treee5ec1becde3b9f05d2fe6b1b1b49cb2732a6960f /amount.cc
parentf32f698d7f097234ebabe725e8f8aaa1fa740753 (diff)
downloadfork-ledger-f8a62c444f070b5e7f1ed00a2a322d01da729775.tar.gz
fork-ledger-f8a62c444f070b5e7f1ed00a2a322d01da729775.tar.bz2
fork-ledger-f8a62c444f070b5e7f1ed00a2a322d01da729775.zip
made several of the buffers used non-static
Diffstat (limited to 'amount.cc')
-rw-r--r--amount.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/amount.cc b/amount.cc
index 98f7cf63..1a538f40 100644
--- a/amount.cc
+++ b/amount.cc
@@ -671,27 +671,26 @@ std::ostream& operator<<(std::ostream& _out, const amount_t& amt)
void parse_quantity(std::istream& in, std::string& value)
{
- static char buf[256];
+ char buf[256];
char c = peek_next_nonws(in);
- READ_INTO(in, buf, 256, c,
+ READ_INTO(in, buf, 255, c,
std::isdigit(c) || c == '-' || c == '.' || c == ',');
value = buf;
}
void parse_commodity(std::istream& in, std::string& symbol)
{
- static char buf[256];
-
+ char buf[256];
char c = peek_next_nonws(in);
if (c == '"') {
in.get(c);
- READ_INTO(in, buf, 256, c, c != '"');
+ READ_INTO(in, buf, 255, c, c != '"');
if (c == '"')
in.get(c);
else
throw amount_error("Quoted commodity symbol lacks closing quote");
} else {
- READ_INTO(in, buf, 256, c, ! std::isspace(c) && ! std::isdigit(c) &&
+ READ_INTO(in, buf, 255, c, ! std::isspace(c) && ! std::isdigit(c) &&
c != '-' && c != '.');
}
symbol = buf;