fix infinite looping on error
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user