diff --git a/source/src/command.cpp b/source/src/command.cpp index 6599c657..2711645e 100644 --- a/source/src/command.cpp +++ b/source/src/command.cpp @@ -369,8 +369,7 @@ int rndn(int a) { return a>0 ? rnd(a) : 0; } COMMANDN(rnd, rndn, ARG_1EXP); void writecfg() { - s_sprintfd(cfgname)("config%csaved.cfg", PATHDIV); - FILE *f = openfile(cfgname, "w"); + FILE *f = openfile(path("config/saved.cfg", true), "w"); if(!f) return; fprintf(f, "// automatically written on exit, DO NOT MODIFY\n// delete this file to have defaults.cfg overwrite these settings\n// modify settings in game, or put settings in autoexec.cfg to override anything\n\n"); fprintf(f, "name %s\nskin %d\n", player1->name, player1->nextskin); diff --git a/source/src/docs.cpp b/source/src/docs.cpp index 06412076..37263579 100644 --- a/source/src/docs.cpp +++ b/source/src/docs.cpp @@ -228,8 +228,7 @@ char *xmlstringenc(char *d, const char *s, size_t len) void docwritebaseref(char *ref, char *schemalocation, char *transformation) { - s_sprintfd(outfile)("docs%cautogenerated_base_reference.xml", PATHDIV); - FILE *f = openfile(outfile, "w"); + FILE *f = openfile(path("docs/autogenerated_base_reference.xml", true), "w"); if(!f) return; char desc[] = "TODO: Description"; diff --git a/source/src/main.cpp b/source/src/main.cpp index 14a41c3d..6a774dd5 100644 --- a/source/src/main.cpp +++ b/source/src/main.cpp @@ -65,8 +65,7 @@ VARF(vsync, -1, -1, 1, initwarning()); void writeinitcfg() { - s_sprintfd(fn)("config%cinit.cfg", PATHDIV); - FILE *f = openfile(fn, "w"); + FILE *f = openfile(path("config/init.cfg", true), "w"); if(!f) return; fprintf(f, "// automatically written on exit, DO NOT MODIFY\n// modify settings in game\n"); fprintf(f, "scr_w %d\n", scr_w);