Skip to content

Commit

Permalink
IniFile: don't lose last character if the file doesn't end with \r\n
Browse files Browse the repository at this point in the history
  • Loading branch information
ksmyth authored and binarymaster committed Dec 20, 2018
1 parent 3265519 commit a5c64a4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src-x86-x64-Fusix/IniFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a5c64a4

Please sign in to comment.