From aaa6ccd26315533ab3700a5ab385cbd008bc8a2a Mon Sep 17 00:00:00 2001 From: illusion0001 <37698908+illusion0001@users.noreply.github.com> Date: Sat, 4 Jan 2025 12:52:57 +0000 Subject: [PATCH] copySave: Remove not needed alloc sprintf --- source/exec_cmd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/exec_cmd.c b/source/exec_cmd.c index 80bab92..36ea529 100644 --- a/source/exec_cmd.c +++ b/source/exec_cmd.c @@ -155,7 +155,7 @@ static void zipSave(const save_entry_t* entry, const char* exp_path) static void copySave(const save_entry_t* save, const char* exp_path) { - char* copy_path; + char copy_path[256] = {0}; if (strncmp(save->path, exp_path, strlen(exp_path)) == 0) { @@ -171,13 +171,11 @@ static void copySave(const save_entry_t* save, const char* exp_path) init_loading_screen("Copying files..."); - asprintf(©_path, "%s%08x_%s_%s/", exp_path, apollo_config.user_id, save->title_id, save->dir_name); + snprintf(copy_path, sizeof(copy_path), "%s%08x_%s_%s/", exp_path, apollo_config.user_id, save->title_id, save->dir_name); LOG("Copying <%s> to %s...", save->path, copy_path); copy_directory(save->path, save->path, copy_path); - free(copy_path); - stop_loading_screen(); show_message("Files successfully copied to:\n%s", exp_path); }