From 3f9ca9644a902ebc6fa546d4f47f53a50763576e Mon Sep 17 00:00:00 2001 From: jp9000 Date: Sat, 1 Feb 2020 21:49:17 -0800 Subject: [PATCH] UI: Fix incorrect parameter value The last parameter is the buffer size (which would include null terminator), not the desired string length. --- UI/obs-app.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UI/obs-app.cpp b/UI/obs-app.cpp index 7568849ad..0dec3db10 100644 --- a/UI/obs-app.cpp +++ b/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;