浏览代码

UI: Fix incorrect parameter

This param is the buffer size, including null terminator
jp9000 5 年之前
父节点
当前提交
f077004523
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      UI/obs-app.cpp

+ 1 - 1
UI/obs-app.cpp

@@ -2027,7 +2027,7 @@ bool GetFileSafeName(const char *name, std::string &file)
 		return false;
 
 	file.resize(len);
-	os_wcs_to_utf8(wfile.c_str(), wfile.size(), &file[0], len);
+	os_wcs_to_utf8(wfile.c_str(), wfile.size(), &file[0], len + 1);
 	return true;
 }