From 9d9a8bd83d324ab5169f01f675d62844964dbd4f Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 21 Jun 2010 13:20:44 -0400 Subject: Corrected a compilation warning --- src/expr.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/expr.cc') 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 buf (new char[static_cast(end_pos - start_pos) + 1]); - in.read(buf.get(), end_pos - start_pos); - buf[end_pos - start_pos] = '\0'; + int len = static_cast(end_pos) - static_cast(start_pos); + in.read(buf.get(), len); + buf[len] = '\0'; set_text(buf.get()); } else { -- cgit v1.2.3