From b7211042d4c2e35472e825c2b70306921df55bc1 Mon Sep 17 00:00:00 2001 From: illusion0001 <37698908+illusion0001@users.noreply.github.com> Date: Tue, 27 Jun 2023 14:07:18 -0500 Subject: [PATCH] Update exec_cmd.c --- 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 2621a96..4ae8698 100644 --- a/source/exec_cmd.c +++ b/source/exec_cmd.c @@ -126,7 +126,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) { @@ -142,13 +142,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); }