mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-12 10:28:08 +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:
@@ -194,9 +194,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||
for(int i = 0; i < app.argc; ++i)
|
||||
{
|
||||
const size_t s = (wcslen(wargv[i])+1) * 2;
|
||||
size_t unused;
|
||||
app.argv[i] = malloc(s);
|
||||
wcstombs_s(&unused, app.argv[i], s, wargv[i], _TRUNCATE);
|
||||
wcstombs(app.argv[i], wargv[i], s);
|
||||
}
|
||||
LocalFree(wargv);
|
||||
|
||||
|
Reference in New Issue
Block a user