(Android) Build fix

This commit is contained in:
twinaphex 2015-02-16 03:38:52 +01:00
parent 935b112a11
commit 47889ff755
2 changed files with 4 additions and 6 deletions

View File

@ -158,15 +158,16 @@ static size_t zlib_file_size(void *handle)
static void *zlib_file_open(const char *path)
{
ssize_t ret;
size_t ret = -1;
bool read_from_file = false;
zlib_file_data_t *data = (zlib_file_data_t*)calloc(1, sizeof(*data));
if (!data)
return NULL;
ret = read_file(path, &data->data);
read_from_file = read_file(path, &data->data, &ret);
if (ret < 0)
if (!read_from_file || ret < 0)
{
RARCH_ERR("Failed to open archive: %s.\n",
path);

View File

@ -116,10 +116,7 @@ static bool read_generic_file(const char *path, void **buf, size_t *len)
rom_buf = malloc(_len + 1);
if (!rom_buf)
{
RARCH_ERR("Couldn't allocate memory.\n");
goto error;
}
if ((ret = fread(rom_buf, 1, _len, file)) < _len)
RARCH_WARN("Didn't read whole file.\n");