diff --git a/code/nel/src/3d/zone_search.cpp b/code/nel/src/3d/zone_search.cpp index 85e5a643a..71704d37f 100644 --- a/code/nel/src/3d/zone_search.cpp +++ b/code/nel/src/3d/zone_search.cpp @@ -61,8 +61,6 @@ CZoneSearch::CZoneSearch() */ pair CZoneSearch::getZoneName(uint x, uint y, uint cx, uint cy) { - char name[13]; - uint zoneY = y / _SizeZoneY + 1; uint zoneX = x / _SizeZoneX; @@ -74,9 +72,7 @@ pair CZoneSearch::getZoneName(uint x, uint y, uint cx, uint cy) char firstLetter = zoneX / 26 + 'A'; char secondLetter = zoneX % 26 + 'A'; - sprintf(name, "%d_%c%c.zonel", zoneY, firstLetter, secondLetter); - - return std::pair(string(name), distance); + return std::pair(NLMISC::toString("%u_%c%c.zonel", zoneY, firstLetter, secondLetter), distance); } @@ -214,12 +210,9 @@ void CZoneSearch::getListZoneId (uint x, uint y, uint sizeArea, vector & std::string CZoneSearch::getZoneNameFromId (uint16 zoneid) { - char name[16]; - sint x = zoneid & 255; sint y = zoneid >> 8; - sprintf (name, "%d_%c%c.zonel", y+1, (char)('A'+(x/26)), (char)('A'+(x%26))); - return string(name); + return NLMISC::toString("%d_%c%c.zonel", y + 1, (char)('A' + (x / 26)), (char)('A' + (x % 26))); }