mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-07-30 02:53:38 +00:00
[c-host] not all versions of mingw support wcstombs_s
While the _s functions are for security as they avoid exceeding the supplied buffer, in our case they are not really required as we are allocating a buffer large enough to store the entire result. Fixes #171
This commit is contained in:
parent
e3343cbd01
commit
6d24dd52d6
3 changed files with 4 additions and 7 deletions
|
@ -215,9 +215,8 @@ static bool dxgi_init(void * pointerShape, const unsigned int pointerSize)
|
|||
IDXGIAdapter1_GetDesc1(this->adapter, &adapterDesc);
|
||||
|
||||
const size_t s = (wcslen(adapterDesc.Description)+1) * 2;
|
||||
size_t unused;
|
||||
char * desc = malloc(s);
|
||||
wcstombs_s(&unused, desc, s, adapterDesc.Description, _TRUNCATE);
|
||||
wcstombs(desc, adapterDesc.Description, s);
|
||||
|
||||
if (strstr(desc, optAdapter) == NULL)
|
||||
{
|
||||
|
@ -238,9 +237,8 @@ static bool dxgi_init(void * pointerShape, const unsigned int pointerSize)
|
|||
if (optOutput)
|
||||
{
|
||||
const size_t s = (wcslen(outputDesc.DeviceName)+1) * 2;
|
||||
size_t unused;
|
||||
char * desc = malloc(s);
|
||||
wcstombs_s(&unused, desc, s, outputDesc.DeviceName, _TRUNCATE);
|
||||
wcstombs(desc, outputDesc.DeviceName, s);
|
||||
|
||||
if (strstr(desc, optOutput) == NULL)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue