Skip to content

Commit

Permalink
Fix wstring_view construction parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
kcat committed Nov 4, 2024
1 parent 19f7b44 commit 522c363
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion alc/backends/wasapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<size_t>(devIdStartEnd - devIdStart)});
std::transform(ret.mGuid.begin(), ret.mGuid.end(), ret.mGuid.begin(),
[](char ch) { return static_cast<char>(std::toupper(ch)); });
}
Expand Down

0 comments on commit 522c363

Please sign in to comment.