diff options
Diffstat (limited to 'src/amount.cc')
-rw-r--r-- | src/amount.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/amount.cc b/src/amount.cc index 788a140c..6baa903c 100644 --- a/src/amount.cc +++ b/src/amount.cc @@ -975,8 +975,15 @@ namespace { { char buf[256]; char c = peek_next_nonws(in); - READ_INTO(in, buf, 255, c, - std::isdigit(c) || c == '-' || c == '.' || c == ','); + int max = 255; + char *p = buf; + if (c == '-') { + *p++ = c; + max--; + in.get(c); + } + READ_INTO(in, p, max, c, + std::isdigit(c) || c == '.' || c == ','); string::size_type len = std::strlen(buf); while (len > 0 && ! std::isdigit(buf[len - 1])) { |