From ef51b2cc1ad43db5a8d734920e4100b6834644fc Mon Sep 17 00:00:00 2001 From: Dethrace Labs <78985374+dethrace-labs@users.noreply.github.com> Date: Sat, 6 Sep 2025 07:19:44 +1200 Subject: [PATCH] OpenUniqueFileB matching --- src/DETHRACE/common/utility.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/DETHRACE/common/utility.c b/src/DETHRACE/common/utility.c index 2127d8d9..6d7156fb 100644 --- a/src/DETHRACE/common/utility.c +++ b/src/DETHRACE/common/utility.c @@ -627,12 +627,14 @@ FILE* OpenUniqueFileB(char* pPrefix, char* pExtension) { FILE* f; tPath_name the_path; + index = 0; for (index = 0; index < 10000; index++) { PathCat(the_path, gApplication_path, pPrefix); sprintf(the_path + strlen(the_path), "%04d.%s", index, pExtension); f = DRfopen(the_path, "rt"); if (f == NULL) { - return DRfopen(the_path, "wb"); + f = DRfopen(the_path, "wb"); + return f; } fclose(f); }