diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 3bf749310..744ef3a78 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -957,7 +957,7 @@ void ExtractMapsFromMpq(uint32 build) { printf("Extract %s (%d/%u) \n", map_ids[z].name, z + 1, map_count); // Loadup map grid data - mpqMapName = acore::StringFormat("World\\Maps\\%s\\%s.wdt", map_ids[z].name, map_ids[z].name); + mpqMapName = acore::StringFormat(R"(World\Maps\%s\%s.wdt)", map_ids[z].name, map_ids[z].name); WDT_file wdt; if (!wdt.loadFile(mpqMapName, false)) { @@ -971,7 +971,7 @@ void ExtractMapsFromMpq(uint32 build) { if (!wdt.main->adt_list[y][x].exist) continue; - mpqFileName = acore::StringFormat("World\\Maps\\%s\\%s_%u_%u.adt", map_ids[z].name, map_ids[z].name, x, y); + mpqFileName = acore::StringFormat(R"(World\Maps\%s\%s_%u_%u.adt)", map_ids[z].name, map_ids[z].name, x, y); outputFileName = acore::StringFormat("%s/maps/%03u%02u%02u.map", output_path, map_ids[z].id, y, x); ConvertADT(mpqFileName, outputFileName, y, x, build); } diff --git a/src/tools/vmap4_extractor/vmapexport.cpp b/src/tools/vmap4_extractor/vmapexport.cpp index 750b5b7f9..efa4b6c42 100644 --- a/src/tools/vmap4_extractor/vmapexport.cpp +++ b/src/tools/vmap4_extractor/vmapexport.cpp @@ -226,7 +226,7 @@ void ParsMapFiles() for (unsigned int i = 0; i < map_count; ++i) { sprintf(id, "%03u", map_ids[i].id); - sprintf(fn, "World\\Maps\\%s\\%s.wdt", map_ids[i].name, map_ids[i].name); + snprintf(fn, sizeof(fn), R"(World\Maps\%s\%s.wdt)", map_ids[i].name, map_ids[i].name); WDTFile WDT(fn, map_ids[i].name); if (WDT.init(id, map_ids[i].id)) { diff --git a/src/tools/vmap4_extractor/wdtfile.cpp b/src/tools/vmap4_extractor/wdtfile.cpp index 3d745cb20..b344b8d2e 100644 --- a/src/tools/vmap4_extractor/wdtfile.cpp +++ b/src/tools/vmap4_extractor/wdtfile.cpp @@ -113,6 +113,6 @@ ADTFile* WDTFile::GetMap(int x, int z) char name[512]; - sprintf(name, "World\\Maps\\%s\\%s_%d_%d.adt", filename.c_str(), filename.c_str(), x, z); + snprintf(name, sizeof(name), R"(World\Maps\%s\%s_%d_%d.adt)", filename.c_str(), filename.c_str(), x, z); return new ADTFile(name); }