1
0
Fork 0

Codechange: use fmt::format to construct error message

pull/10968/head
Rubidium 2023-06-06 17:09:57 +02:00 committed by rubidium42
parent 4de9b8a988
commit 5e9a1eb790
1 changed files with 3 additions and 5 deletions

View File

@ -82,14 +82,12 @@ TileIndex TileAdd(TileIndex tile, TileIndexDiff add,
y = TileY(tile) + dy;
if (x >= Map::SizeX() || y >= Map::SizeY()) {
char buf[512];
seprintf(buf, lastof(buf), "TILE_ADD(%s) when adding 0x%.4X and 0x%.4X failed",
std::string message = fmt::format("TILE_ADD({}) when adding 0x{:04X} and 0x{%04X} failed",
exp, (uint32)tile, add);
#if !defined(_MSC_VER)
fmt::print(stderr, "{}:{} {}\n", file, line, buf);
fmt::print(stderr, "{}:{} {}\n", file, line, message);
#else
_assert(buf, (char*)file, line);
_assert(message.data(), (char*)file, line);
#endif
}