diff --git a/toml/parser.hpp b/toml/parser.hpp index 8e8a7ef..a7cf57e 100644 --- a/toml/parser.hpp +++ b/toml/parser.hpp @@ -1939,7 +1939,8 @@ parse(std::istream& is, const std::string& fname = "unknown file") is.seekg(beg); // read whole file as a sequence of char - std::vector letters(fsize); + assert(fsize >= 0); + std::vector letters(static_cast(fsize)); is.read(letters.data(), fsize); detail::location>