mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-16 16:28:09 +08:00
fix #88: check if input is null-terminated or not
This commit is contained in:
@@ -1949,6 +1949,11 @@ parse(std::istream& is, const std::string& fname = "unknown file")
|
||||
std::vector<char> letters(static_cast<std::size_t>(fsize));
|
||||
is.read(letters.data(), fsize);
|
||||
|
||||
if(letters.back() == '\0')
|
||||
{
|
||||
letters.pop_back();
|
||||
}
|
||||
|
||||
detail::location<std::vector<char>>
|
||||
loc(std::move(fname), std::move(letters));
|
||||
|
||||
|
Reference in New Issue
Block a user