Commit 75d4cff7 authored by Julien Wadel's avatar Julien Wadel
Browse files

UWP : Fix multi-byte string conversions

parent fe0b32ff
......@@ -402,9 +402,10 @@ public:
size_t returnlen;
uint8_t capabilities = 0;
inputlen = wcslen(DeviceName->Data()) + 1;
name = (char *)ms_malloc(inputlen);
if (wcstombs_s(&returnlen, name, inputlen, DeviceName->Data(), inputlen) != 0) {
inputlen = wcslen(DeviceName->Data())+1;
returnlen = inputlen * 2;
name = (char *)ms_malloc(returnlen);
if ((err = WideCharToMultiByte(CP_ACP, 0, DeviceName->Data(), -1, name, (int)returnlen, NULL, NULL)) == 0) {
ms_error("mswasapi: Cannot convert card name to multi-byte string.");
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment