fix infinite looping on error

This commit is contained in:
Glenn Maynard
2004-04-18 23:06:56 +00:00
parent 187c490303
commit d5211311c6
+11 -4
View File
@@ -46,9 +46,18 @@ bool IniFile::ReadFile()
} }
CString keyname; CString keyname;
CString line; while( 1 )
while( f.GetLine(line) )
{ {
CString line;
switch( f.GetLine(line) )
{
case -1:
error = f.GetError();
return false;
case 0:
return true; /* eof */
}
if(line.size() >= 3 && if(line.size() >= 3 &&
line[0] == '\xef' && line[0] == '\xef' &&
line[1] == '\xbb' && line[1] == '\xbb' &&
@@ -80,8 +89,6 @@ bool IniFile::ReadFile()
} }
} }
} }
return true;
} }
// writes data stored in class to ini file // writes data stored in class to ini file