Remove str_fmt and str_vfmt

This commit is contained in:
Jonathan G Rennison
2023-05-30 00:53:31 +01:00
parent 94c422499f
commit 6297abdb3b
5 changed files with 11 additions and 43 deletions

View File

@@ -173,18 +173,16 @@ void debug_print(const char *dbg, const char *buf)
have_inited = true;
unsigned int num = 0;
int pid = getpid();
const char *fn = nullptr;
for(;;) {
free(fn);
fn = str_fmt("random-out-%d-%u.log", pid, num);
f = FioFOpenFile(fn, "wx", AUTOSAVE_DIR);
std::string fn = stdstr_fmt("random-out-%d-%u.log", pid, num);
f = FioFOpenFile(fn.c_str(), "wx", AUTOSAVE_DIR);
if (f == nullptr && errno == EEXIST) {
num++;
continue;
}
break;
}
free(fn);
}
#else
static FILE *f = FioFOpenFile("random-out.log", "wb", AUTOSAVE_DIR);