mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-17 18:40:02 +00:00
game_launch: fix Win32 main
This commit is contained in:
parent
a967caa91f
commit
19303f7bd7
@ -153,7 +153,7 @@ int __stdcall WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdLine, int
|
|||||||
int ret, i;
|
int ret, i;
|
||||||
|
|
||||||
lpArgv = CommandLineToArgvW( GetCommandLineW(), &szArgc );
|
lpArgv = CommandLineToArgvW( GetCommandLineW(), &szArgc );
|
||||||
szArgv = ( char** )malloc( szArgc * sizeof( char* ));
|
szArgv = ( char** )malloc( (szArgc + 1) * sizeof( char* ));
|
||||||
|
|
||||||
for( i = 0; i < szArgc; ++i )
|
for( i = 0; i < szArgc; ++i )
|
||||||
{
|
{
|
||||||
@ -161,6 +161,7 @@ int __stdcall WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdLine, int
|
|||||||
szArgv[i] = ( char* )malloc( size );
|
szArgv[i] = ( char* )malloc( size );
|
||||||
wcstombs( szArgv[i], lpArgv[i], size );
|
wcstombs( szArgv[i], lpArgv[i], size );
|
||||||
}
|
}
|
||||||
|
szArgv[szArgc] = 0;
|
||||||
|
|
||||||
LocalFree( lpArgv );
|
LocalFree( lpArgv );
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user