summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/error.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/error.cc b/src/error.cc
index 63b9885c..d5abe4de 100644
--- a/src/error.cc
+++ b/src/error.cc
@@ -96,10 +96,10 @@ string source_context(const path& file,
ifstream in(file);
in.seekg(pos, std::ios::beg);
- scoped_array<char> buf(new char[len + 1]);
+ scoped_array<char> buf(new char[static_cast<std::size_t>(len) + 1]);
in.read(buf.get(), static_cast<std::streamsize>(len));
- assert(in.gcount() == len);
- buf[len] = '\0';
+ assert(in.gcount() == static_cast<std::streamsize>(len));
+ buf[static_cast<std::size_t>(len)] = '\0';
bool first = true;
for (char * p = std::strtok(buf.get(), "\n");