summaryrefslogtreecommitdiff
path: root/src/expr.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-23 19:31:06 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-23 19:31:06 -0400
commiteda6cbd0146d371653feec70e0eb3ee4e4c56379 (patch)
treeaeb4e1ace0f9b284789f66f3ceb30bed66946b93 /src/expr.cc
parent014fde3418783d1ee1ec7fe4ea6c8b04ae7f6cd8 (diff)
parent93807fade69dd4f0ec575eda78fe1a77a85c24e3 (diff)
downloadfork-ledger-eda6cbd0146d371653feec70e0eb3ee4e4c56379.tar.gz
fork-ledger-eda6cbd0146d371653feec70e0eb3ee4e4c56379.tar.bz2
fork-ledger-eda6cbd0146d371653feec70e0eb3ee4e4c56379.zip
Merge branch 'next'
Diffstat (limited to 'src/expr.cc')
-rw-r--r--src/expr.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/expr.cc b/src/expr.cc
index 0769d575..5bc537d9 100644
--- a/src/expr.cc
+++ b/src/expr.cc
@@ -52,8 +52,9 @@ void expr_t::parse(std::istream& in, const parse_flags_t& flags,
in.seekg(start_pos, std::ios::beg);
scoped_array<char> buf
(new char[static_cast<std::size_t>(end_pos - start_pos) + 1]);
- in.read(buf.get(), end_pos - start_pos);
- buf[end_pos - start_pos] = '\0';
+ int len = static_cast<int>(end_pos) - static_cast<int>(start_pos);
+ in.read(buf.get(), len);
+ buf[len] = '\0';
set_text(buf.get());
}
else {