mirror of
https://github.com/stascorp/rdpwrap.git
synced 2024-11-09 09:48:21 +00:00
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