UI: Allocate space for null terminator

master
Richard Stanway 2019-02-19 21:55:31 +01:00
parent 8694859e85
commit 69ffce3479
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ std::string vstrprintf(const char *format, va_list args)
return std::string();
std::string str;
int size = (int)vsnprintf(nullptr, 0, format, args);
int size = (int)vsnprintf(nullptr, 0, format, args) + 1;
str.resize(size);
vsnprintf(&str[0], size, format, args);
return str;