Fixed an issue where formatting translation strings could lead to crashes on some platforms

This commit is contained in:
Leon Styhre 2024-07-20 22:17:44 +02:00
parent 5fefb5960b
commit 0582856b84

View file

@ -647,8 +647,10 @@ namespace Utils
va_copy(copy, args);
const int length {vsnprintf(nullptr, 0, &stringArg[0], copy)};
va_end(copy);
std::string buffer(length, '\0');
va_copy(copy, args);
vsnprintf(&buffer[0], length + 1, &stringArg[0], copy);
va_end(copy);