Skip to content

Commit

Permalink
Merge pull request #258 from pinotree/read-streamsize
Browse files Browse the repository at this point in the history
fix: manually cast file size to std::streamsize
  • Loading branch information
ToruNiina authored Jul 21, 2024
2 parents f33ca74 + fe19e7e commit 4dd83fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/toml11/parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3526,7 +3526,7 @@ try_parse(std::istream& is, std::string fname = "unknown file", spec s = spec::d
// read whole file as a sequence of char
assert(fsize >= 0);
std::vector<detail::location::char_type> letters(static_cast<std::size_t>(fsize), '\0');
is.read(reinterpret_cast<char*>(letters.data()), fsize);
is.read(reinterpret_cast<char*>(letters.data()), static_cast<std::streamsize>(fsize));

return detail::parse_impl<TC>(std::move(letters), std::move(fname), std::move(s));
}
Expand Down

0 comments on commit 4dd83fe

Please sign in to comment.