mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-08-24 10:14:13 -05:00
UI: Allocate space for null terminator
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user