From 13a9fcba5b96b9f47d802a9b23e29dd158153d04 Mon Sep 17 00:00:00 2001 From: philippegorley Date: Fri, 2 Aug 2019 11:14:07 -0400 Subject: [PATCH] string_utils: don't add null byte to wide strings Fixes call recording in windows. The filename was cut short by the null byte inserted before the filename and extension. Change-Id: I502d5f4c0360b19ea58ebb1fffbc61ec41567dfa --- src/string_utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/string_utils.cpp b/src/string_utils.cpp index ed73294c2..2f432214d 100644 --- a/src/string_utils.cpp +++ b/src/string_utils.cpp @@ -39,7 +39,7 @@ namespace jami { std::wstring to_wstring(const std::string& s) { - int slength = (int)s.length() + 1; + int slength = (int)s.length(); int len = MultiByteToWideChar(CP_UTF8, 0, s.c_str(), slength, nullptr, 0); if (not len) throw std::runtime_error("Can't convert string to wchar"); -- 2.22.0