Update C sources

This commit is contained in:
Milan Nikolic 2017-02-13 16:16:25 +01:00
parent f2b720ea98
commit 0d9012a519
4 changed files with 21 additions and 16 deletions

View file

@ -1025,14 +1025,14 @@ int StorageLoadValue(int position)
{
// Get file size
fseek(storageFile, 0, SEEK_END);
int fileSize = ftell(storageFile); // Size in bytes
int fileSize = ftell(storageFile); // Size in bytes
rewind(storageFile);
if (fileSize < (position*4)) TraceLog(WARNING, "Storage position could not be found");
else
{
fseek(storageFile, (position*4), SEEK_SET);
fread(&value, 1, 4, storageFile);
fread(&value, 4, 1, storageFile); // Read 1 element of 4 bytes size
}
fclose(storageFile);