IniFile: don't lose last character if the file doesn't end with \r\n
This commit is contained in:
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++)
|
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;
|
EndStringPos = i;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user