Fix argv parameter to main() on Windows
Task-number: QTBUG-44050 Change-Id: I5b7ddec9d66158d8075ab091b01e883520e5414e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
parent
9718cb330c
commit
f562244f33
@ -105,9 +105,10 @@ extern "C" int APIENTRY WinMain(HINSTANCE, HINSTANCE, LPSTR /*cmdParamarg*/, int
|
||||
wchar_t **argvW = CommandLineToArgvW(GetCommandLineW(), &argc);
|
||||
if (!argvW)
|
||||
return -1;
|
||||
char **argv = new char *[argc];
|
||||
char **argv = new char *[argc + 1];
|
||||
for (int i = 0; i < argc; ++i)
|
||||
argv[i] = wideToMulti(CP_ACP, argvW[i]);
|
||||
argv[argc] = Q_NULLPTR;
|
||||
LocalFree(argvW);
|
||||
const int exitCode = main(argc, argv);
|
||||
for (int i = 0; i < argc; ++i)
|
||||
|
Loading…
Reference in New Issue
Block a user