mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-02-28 23:55:54 +00:00
Replace zr_common_file_load again
This commit is contained in:
parent
2e11895ef9
commit
3e3cc9f2f2
@ -15,6 +15,8 @@
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <streams/file_stream.h>
|
||||
|
||||
#include "zr_common.h"
|
||||
|
||||
#include "../menu_display.h"
|
||||
@ -43,15 +45,9 @@ struct zr_image zr_common_image_load(const char *filename)
|
||||
|
||||
char* zr_common_file_load(const char* path, size_t* size)
|
||||
{
|
||||
char *buf;
|
||||
FILE *fd = fopen(path, "rb");
|
||||
|
||||
fseek(fd, 0, SEEK_END);
|
||||
*size = (size_t)ftell(fd);
|
||||
fseek(fd, 0, SEEK_SET);
|
||||
buf = (char*)calloc(*size, 1);
|
||||
fread(buf, *size, 1, fd);
|
||||
fclose(fd);
|
||||
void *buf;
|
||||
ssize_t *length = (ssize_t*)size;
|
||||
retro_read_file(path, &buf, length);
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user