[winpr,ini] fix cast warnings

This commit is contained in:
Armin Novak 2023-07-28 09:15:00 +02:00 committed by akallabeth
parent 077aff0217
commit 20653aee1d

View File

@ -175,10 +175,13 @@ static BOOL IniFile_Load_File(wIniFile* ini, const char* filename)
if (fileSize < 1)
goto out_file;
if (!IniFile_BufferResize(ini, fileSize + 2))
if (fileSize > SIZE_MAX)
goto out_file;
if (fread(ini->buffer, fileSize, 1ul, fp) != 1)
if (!IniFile_BufferResize(ini, (size_t)fileSize + 2))
goto out_file;
if (fread(ini->buffer, (size_t)fileSize, 1ul, fp) != 1)
goto out_file;
ini->buffer[fileSize] = '\n';