diff --git a/include/mio/detail/mmap.ipp b/include/mio/detail/mmap.ipp index 2dbfe1f..eef5db5 100644 --- a/include/mio/detail/mmap.ipp +++ b/include/mio/detail/mmap.ipp @@ -74,7 +74,7 @@ std::wstring s_2_ws(const std::string& s) return{}; const auto s_length = static_cast(s.length()); auto buf = std::vector(s_length); - const auto wide_char_count = MultiByteToWideChar(CP_UTF8, 0, s.c_str(), sLength, buf.data(), s_length); + const auto wide_char_count = MultiByteToWideChar(CP_UTF8, 0, s.c_str(), s_length, buf.data(), s_length); return std::wstring(buf.data(), wide_char_count); } diff --git a/single_include/mio/mio.hpp b/single_include/mio/mio.hpp index f1b53c7..124f1fd 100644 --- a/single_include/mio/mio.hpp +++ b/single_include/mio/mio.hpp @@ -816,7 +816,7 @@ std::wstring s_2_ws(const std::string& s) return{}; const auto s_length = static_cast(s.length()); auto buf = std::vector(s_length); - const auto wide_char_count = MultiByteToWideChar(CP_UTF8, 0, s.c_str(), sLength, buf.data(), s_length); + const auto wide_char_count = MultiByteToWideChar(CP_UTF8, 0, s.c_str(), s_length, buf.data(), s_length); return std::wstring(buf.data(), wide_char_count); }