mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 12:32:52 +00:00
additional error tracking on reading file streams if fseek
fails
This commit is contained in:
parent
586c620609
commit
a8fea21f11
@ -107,13 +107,15 @@ static bool read_generic_file(const char *path, void **buf, ssize_t *len)
|
||||
if (!file)
|
||||
goto error;
|
||||
|
||||
fseek(file, 0, SEEK_END);
|
||||
if (fseek(file, 0, SEEK_END) != 0)
|
||||
goto error;
|
||||
|
||||
_len = ftell(file);
|
||||
if (_len < 0)
|
||||
goto error;
|
||||
|
||||
rewind(file);
|
||||
if (fseek(file, 0, SEEK_SET) != 0)
|
||||
goto error;
|
||||
|
||||
rom_buf = malloc(_len + 1);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user