Browse Source

UI: Fix incorrect parameter value

The last parameter is the buffer size (which would include null
terminator), not the desired string length.
jp9000 5 years ago
parent
commit
3f9ca9644a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      UI/obs-app.cpp

+ 1 - 1
UI/obs-app.cpp

@@ -2007,7 +2007,7 @@ bool GetFileSafeName(const char *name, std::string &file)
 		return false;
 
 	wfile.resize(len);
-	os_utf8_to_wcs(name, base_len, &wfile[0], len);
+	os_utf8_to_wcs(name, base_len, &wfile[0], len + 1);
 
 	for (size_t i = wfile.size(); i > 0; i--) {
 		size_t im1 = i - 1;