1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Remove deprecated usage of sprintf

This commit is contained in:
Ivan Savenko
2022-12-25 14:04:12 +02:00
parent 405b2976d5
commit 94597e7af6
2 changed files with 7 additions and 8 deletions

View File

@@ -161,10 +161,12 @@ public:
std::string toString() const
{
//Performance is important here
char str[16] = {};
std::sprintf(str, "(%d %d %d)", x, y, z);
std::string result = "{" +
std::to_string(x) + " " +
std::to_string(y) + " " +
std::to_string(z) + "}";
return std::string(str);
return result;
}
bool valid() const //Should be named "isValid"?