mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-01-10 01:20:06 +00:00
fix: check file content is empty or not
This commit is contained in:
parent
37769e28f0
commit
f98615d0df
@ -1949,7 +1949,7 @@ 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')
|
||||
if(!letters.empty() && letters.back() == '\0')
|
||||
{
|
||||
letters.pop_back();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user