fix: check file content is empty or not

This commit is contained in:
ToruNiina 2019-10-30 16:48:39 +09:00
parent 37769e28f0
commit f98615d0df

View File

@ -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();
}