From 522c36390f564fae675db0f3357907d3ced99f41 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 4 Nov 2024 09:48:27 -0800 Subject: [PATCH] Fix wstring_view construction parameters --- alc/backends/wasapi.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/alc/backends/wasapi.cpp b/alc/backends/wasapi.cpp index 32e4dbd7..e1257135 100644 --- a/alc/backends/wasapi.cpp +++ b/alc/backends/wasapi.cpp @@ -382,7 +382,8 @@ auto GetDeviceNameAndGuid(const DeviceHandle &device) -> NameGUIDPair devIdStart += 2; // L"}." if(auto devIdStartEnd = wcschr(devIdStart, L'#')) { - ret.mGuid = wstr_to_utf8(std::wstring_view{devIdStart, devIdStartEnd}); + ret.mGuid = wstr_to_utf8(std::wstring_view{devIdStart, + static_cast(devIdStartEnd - devIdStart)}); std::transform(ret.mGuid.begin(), ret.mGuid.end(), ret.mGuid.begin(), [](char ch) { return static_cast(std::toupper(ch)); }); } -- 2.11.4.GIT