File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -155,10 +155,16 @@ static void getUserName(FFPlatform* platform)
155155
156156static void getHostName (FFPlatform * platform )
157157{
158- wchar_t buffer [128 ];
158+ wchar_t buffer [256 ];
159159 DWORD len = ARRAY_SIZE (buffer );
160- if (GetComputerNameExW (ComputerNameDnsHostname , buffer , & len ))
161- ffStrbufSetWS (& platform -> hostName , buffer );
160+ if (GetComputerNameExW (ComputerNameDnsHostname , buffer , & len ) && len > 0 )
161+ ffStrbufSetNWS (& platform -> hostName , len , buffer );
162+ else
163+ {
164+ len = ARRAY_SIZE (buffer );
165+ if (GetComputerNameExW (ComputerNameNetBIOS , buffer , & len ) && len > 0 )
166+ ffStrbufSetNWS (& platform -> hostName , len , buffer );
167+ }
162168}
163169
164170static void getUserShell (FFPlatform * platform )
You can’t perform that action at this time.
0 commit comments