Fix wrong string printf usage

This commit is contained in:
xtreme8000 2023-02-08 01:53:38 +01:00
parent 76998a7234
commit c26461f455
2 changed files with 5 additions and 5 deletions

View file

@ -25,7 +25,7 @@ bool level_archive_create(struct level_archive* la, string_t filename) {
assert(la && filename);
string_t tmp;
string_init_printf(tmp, "saves/%s/level.dat", filename);
string_init_printf(tmp, "saves/%s/level.dat", string_get_cstr(filename));
char* c_tmp = string_clear_get_str(tmp);
if(!c_tmp)

View file

@ -70,10 +70,10 @@ bool region_archive_create_new(struct region_archive* ra, string_t world_name,
if(dimension == WORLD_DIM_OVERWORLD) {
string_init_printf(ra->file_name, "saves/%s/region/r.%i.%i.mcr",
world_name, x, z);
string_get_cstr(world_name), x, z);
} else {
string_init_printf(ra->file_name, "saves/%s/DIM-1/region/r.%i.%i.mcr",
world_name, x, z);
string_get_cstr(world_name), x, z);
}
FILE* f = fopen(string_get_cstr(ra->file_name), "w");
@ -111,10 +111,10 @@ bool region_archive_create(struct region_archive* ra, string_t world_name,
if(dimension == WORLD_DIM_OVERWORLD) {
string_init_printf(ra->file_name, "saves/%s/region/r.%i.%i.mcr",
world_name, x, z);
string_get_cstr(world_name), x, z);
} else {
string_init_printf(ra->file_name, "saves/%s/DIM-1/region/r.%i.%i.mcr",
world_name, x, z);
string_get_cstr(world_name), x, z);
}
ra->x = x;