Browse Source

UI: Allocate space for null terminator

Richard Stanway 6 years ago
parent
commit
69ffce3479
1 changed files with 1 additions and 1 deletions
  1. 1 1
      UI/win-update/win-update-helpers.cpp

+ 1 - 1
UI/win-update/win-update-helpers.cpp

@@ -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;