From 336b26f72c44092c02a220266f876bcbe67fda97 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Mon, 21 Sep 2026 19:03:32 +0000 Subject: [PATCH] Match ESMisc savedata deletion --- src/utility/iplESMisc.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utility/iplESMisc.cpp b/src/utility/iplESMisc.cpp index 1b4579f5..e117a295 100644 --- a/src/utility/iplESMisc.cpp +++ b/src/utility/iplESMisc.cpp @@ -834,13 +834,13 @@ namespace ipl { } ESError ESMisc::DeleteSavedata(ESTitleId titleId, EGG::Heap* heap) { - s32 ret; char dirPath[0x80] ALIGN32; char filePath[0x41]; char* entries = NULL; u32 entryCount = 0; char* entry; u32 i; + s32 ret; sprintf(dirPath + 0x20, "/title/%08x/%08x/data/", NANDTitleIdHi(titleId), NANDTitleIdLo(titleId)); ret = NANDReadDir(dirPath + 0x20, NULL, &entryCount); @@ -864,13 +864,14 @@ namespace ipl { } entry = entries; - for (i = 0; i < entryCount; i++) { + for (i = 0; i < entryCount;) { snprintf(filePath + 0x1c, 0x40, "%s%s", dirPath + 0x20, entry); (filePath + 0x1c)[0x40] = 0; ret = NANDPrivateDelete(filePath + 0x1c); if (ret != ES_ERR_OK) { ES_ERR_REPORT("Failed to delete %s: %d", filePath + 0x1c, ret); } + i++; entry += strlen(entry) + 1; } -- 2.49.1