X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/011a524e9e60a28719f34b1f78d40e35a08a41a8..84cff9658571992925bfb02b916fb17285ba257f:/src/msw/utils.cpp diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 047ef9a22e..66414baaa2 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -199,7 +199,7 @@ bool wxGetFullHostName(wxChar *buf, int maxSize) if ( pHostEnt ) { - host = pHostEnt->h_name; + host = wxString::FromAscii(pHostEnt->h_name); } } } @@ -600,14 +600,16 @@ bool wxGetEnv(const wxString& var, wxString *value) { #ifdef __WIN16__ const wxChar* ret = wxGetenv(var); - if (ret) + if ( !ret ) + return FALSE; + + if ( value ) { *value = ret; - return TRUE; } - else - return FALSE; -#else + + return TRUE; +#else // Win32 // first get the size of the buffer DWORD dwRet = ::GetEnvironmentVariable(var, NULL, 0); if ( !dwRet ) @@ -623,7 +625,7 @@ bool wxGetEnv(const wxString& var, wxString *value) } return TRUE; -#endif +#endif // Win16/32 } bool wxSetEnv(const wxString& var, const wxChar *value)