From 3c0312961bed74e4da33199656df1e9e42451eb4 Mon Sep 17 00:00:00 2001 From: Pablo Curiel Date: Sat, 14 Jan 2023 00:51:54 +0100 Subject: [PATCH] gc_dumper: fix storage device path generation --- code_templates/gc_dumper.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/code_templates/gc_dumper.c b/code_templates/gc_dumper.c index 49b99c5..8cb96fe 100644 --- a/code_templates/gc_dumper.c +++ b/code_templates/gc_dumper.c @@ -666,9 +666,9 @@ static void generateDumpTxt(void) ts.tm_year, ts.tm_mon, ts.tm_mday, ts.tm_hour, ts.tm_min, ts.tm_sec); } -static bool saveFileData(const char *path, void *data, size_t data_size) +static bool saveFileData(const char *filepath, void *data, size_t data_size) { - if (!path || !*path || !data || !data_size) + if (!filepath || !*filepath || !data || !data_size) { consolePrint("invalid parameters to save file data!\n"); return false; @@ -676,22 +676,22 @@ static bool saveFileData(const char *path, void *data, size_t data_size) if (useUsbHost()) { - if (!usbSendFilePropertiesCommon(data_size, path)) + if (!usbSendFilePropertiesCommon(data_size, filepath)) { - consolePrint("failed to send file properties for \"%s\"!\n", path); + consolePrint("failed to send file properties for \"%s\"!\n", filepath); return false; } if (!usbSendFileData(data, data_size)) { - consolePrint("failed to send file data for \"%s\"!\n", path); + consolePrint("failed to send file data for \"%s\"!\n", filepath); return false; } } else { - FILE *fp = fopen(path, "wb"); + FILE *fp = fopen(filepath, "wb"); if (!fp) { - consolePrint("failed to open \"%s\" for writing!\n", path); + consolePrint("failed to open \"%s\" for writing!\n", filepath); return false; } @@ -700,8 +700,8 @@ static bool saveFileData(const char *path, void *data, size_t data_size) if (ret != data_size) { - consolePrint("failed to write 0x%lX byte(s) to \"%s\"! (%d)\n", data_size, path, errno); - remove(path); + consolePrint("failed to write 0x%lX byte(s) to \"%s\"! (%d)\n", data_size, filepath, errno); + remove(filepath); } } @@ -738,7 +738,7 @@ static char *generateOutputFileName(const char *extension) return NULL; } - sprintf(prefix, "%s:/gamecard_data/", g_storageMenuElementOption.selected == 0 ? DEVOPTAB_SDMC_DEVICE : g_umsDevices[g_storageMenuElementOption.selected - 2].name); + sprintf(prefix, "%s/gamecard_data/", g_storageMenuElementOption.selected == 0 ? DEVOPTAB_SDMC_DEVICE : g_umsDevices[g_storageMenuElementOption.selected - 2].name); } output = utilsGeneratePath(prefix, filename, extension);