diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2014-05-28 11:57:00 +0200 |
|---|---|---|
| committer | Pierre Bourdon <delroth@gmail.com> | 2014-05-28 11:57:00 +0200 |
| commit | ce139622f602c8b879295864c8da3e5dd7b1c295 (patch) | |
| tree | ce25f82be27411113622e93283c91a06d91222b0 /Source/Core/Common/IniFile.cpp | |
| parent | 3d21c6777eb78af05dac2a651dd591046a4852b4 (diff) | |
| parent | 0782d106dbfb07aa470a573222092fbca2908a53 (diff) | |
Merge pull request #392 from RachelBryk/error-check-ini-file
Check for errors when reading lines from ini files.
Diffstat (limited to 'Source/Core/Common/IniFile.cpp')
| -rw-r--r-- | Source/Core/Common/IniFile.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/Core/Common/IniFile.cpp b/Source/Core/Common/IniFile.cpp index fc90b3500e..1fc302bac8 100644 --- a/Source/Core/Common/IniFile.cpp +++ b/Source/Core/Common/IniFile.cpp @@ -345,8 +345,11 @@ bool IniFile::Load(const std::string& filename, bool keep_current_data) while (!in.eof()) { char templine[MAX_BYTES]; - in.getline(templine, MAX_BYTES); - std::string line = templine; + std::string line; + if (in.getline(templine, MAX_BYTES)) + line = templine; + else + return false; #ifndef _WIN32 // Check for CRLF eol and convert it to LF |
