From 4d6e569f985df29b3529c898716c19c0d5f8bc8f Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 18 Dec 2016 14:03:29 +0100 Subject: [PATCH] Changed: Use NLMISC::toString instead of sprintf --HG-- branch : develop --- code/nel/src/3d/zone_search.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) 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))); }