mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 16:39:43 +00:00
(menu_entries_cbs.c) Use write_file wrapper
This commit is contained in:
parent
a93986610b
commit
dd30be4da4
@ -92,12 +92,10 @@ error:
|
||||
return 0;
|
||||
}
|
||||
|
||||
int cb_core_updater_download(void *data_, size_t len)
|
||||
int cb_core_updater_download(void *data, size_t len)
|
||||
{
|
||||
FILE *f;
|
||||
const char* file_ext = NULL;
|
||||
char output_path[PATH_MAX_LENGTH], msg[PATH_MAX_LENGTH];
|
||||
char *data = (char*)data_;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (!data)
|
||||
@ -105,15 +103,10 @@ int cb_core_updater_download(void *data_, size_t len)
|
||||
|
||||
fill_pathname_join(output_path, settings->libretro_directory,
|
||||
core_updater_path, sizeof(output_path));
|
||||
|
||||
f = fopen(output_path, "wb");
|
||||
|
||||
if (!f)
|
||||
if (!write_file(output_path, data, len))
|
||||
return -1;
|
||||
|
||||
fwrite(data, 1, len, f);
|
||||
fclose(f);
|
||||
|
||||
|
||||
snprintf(msg, sizeof(msg), "Download complete: %s.",
|
||||
core_updater_path);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user