1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-21 18:53:32 +00:00

Fixed broken while loop

This commit is contained in:
Bryan Roe
2020-07-27 09:58:04 -07:00
parent c986d60132
commit 453b5cdf5b

View File

@@ -189,15 +189,14 @@ int __fastcall utilx_readfile2(char* filename, char** data)
{
*data = malloc(1024);
if (*data == NULL) { fclose(pFile); return 0; }
do
while((len = fread((*data) + count, 1, 1023, pFile))>0)
{
len = fread((*data) + count, 1, 1023, pFile);
count += len;
if (len == 1023)
{
if ((*data = realloc(*data, count + 1024)) == NULL) { ILIBCRITICALEXIT(254); }
}
} while (len == 100);
}
(*data)[count] = 0;
fclose(pFile);
}