mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-17 09:08:08 +08:00
fix: open file as binary-mode #16
to avoid inconsistency between file size (obtained by tellg) and the size of the actual contents that would be read later
This commit is contained in:
@@ -1517,7 +1517,7 @@ inline table parse(std::istream& is, std::string fname = "unknown file")
|
||||
|
||||
inline table parse(const std::string& fname)
|
||||
{
|
||||
std::ifstream ifs(fname.c_str());
|
||||
std::ifstream ifs(fname.c_str(), std::ios_base::binary);
|
||||
if(!ifs.good())
|
||||
{
|
||||
throw std::runtime_error("toml::parse: file open error -> " + fname);
|
||||
|
Reference in New Issue
Block a user