OpenUniqueFileB matching

This commit is contained in:
Dethrace Labs 2025-09-06 07:19:44 +12:00 committed by Dethrace Engineering Department
parent f77755b94e
commit ef51b2cc1a
1 changed files with 3 additions and 1 deletions

View File

@ -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);
}