wfreerdp: Fix the crash when 'HOME' env is not defined. Now use 'HOMEDRIVE' and 'HOMEPATH' to combine it if it don't exist.
This commit is contained in:
parent
7b30f732f2
commit
77523cf587
@ -598,6 +598,14 @@ INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||
WSADATA wsa_data;
|
||||
WNDCLASSEX wnd_cls;
|
||||
|
||||
if (NULL == getenv("HOME"))
|
||||
{
|
||||
char home[MAX_PATH * 2] = "HOME=";
|
||||
strcat(home, getenv("HOMEDRIVE"));
|
||||
strcat(home, getenv("HOMEPATH"));
|
||||
_putenv(home);
|
||||
}
|
||||
|
||||
if (WSAStartup(0x101, &wsa_data) != 0)
|
||||
return 1;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user