mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-10 19:09:45 +01:00
Fix return value of PHYSFS_fileLength() being stored in a smaller size
The function returns a PHYSFS_sint64, but we forcefully shove it into a PHYSFS_uint32. This means we throw away all the negative numbers, which is bad because the function returns -1 if the size of the file can't be determined; plus, we also throw away 32 bits of information, reducing our range of supported file sizes from 9 exabytes to 4 gigabytes. File size support is only as good as the weakeast link, and it looks like one of the consumers of FILESYSTEM_loadFileToMemory(), SDL_RWFromConstMem(), only takes in a signed 32-bit integer of size; however, I would still like to do at least the bare minimum to support as many file sizes as we can, and changing types around is one of those bare minimums.
This commit is contained in:
parent
88b3390e7d
commit
888844cd3a
1 changed files with 1 additions and 1 deletions
|
@ -360,7 +360,7 @@ void FILESYSTEM_loadFileToMemory(
|
|||
{
|
||||
return;
|
||||
}
|
||||
PHYSFS_uint32 length = PHYSFS_fileLength(handle);
|
||||
PHYSFS_sint64 length = PHYSFS_fileLength(handle);
|
||||
if (len != NULL)
|
||||
{
|
||||
*len = length;
|
||||
|
|
Loading…
Reference in a new issue