IniFile: don't lose last character if the file doesn't end with \r\n

master
Kevin Smyth 6 years ago committed by Stanislav Motylkov
parent 326551985f
commit a5c64a4331

@ -127,7 +127,12 @@ DWORD INI_FILE::GetFileStringFromNum(DWORD StringNumber, char *RetString, DWORD
for (DWORD i = FileStringsMap[StringNumber]; i < FileSize; i++)
{
if ((FileRaw[i] == '\r' && FileRaw[i + 1] == '\n') || i == (FileSize - 1))
if (i == (FileSize - 1))
{
EndStringPos = FileSize;
break;
}
if (FileRaw[i] == '\r' && FileRaw[i + 1] == '\n')
{
EndStringPos = i;
break;

Loading…
Cancel
Save