Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #392 from RachelBryk/error-check-ini-file
Check for errors when reading lines from ini files.
  • Loading branch information
delroth committed May 28, 2014
2 parents 3d21c67 + 0782d10 commit ce13962
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Source/Core/Common/IniFile.cpp
Expand Up @@ -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
Expand Down

0 comments on commit ce13962

Please sign in to comment.