X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1a5e269be8f74af2674245791b544cf56b3e0533..d0e7cf009d6313a9028f91713d1ed8973c9e4efb:/src/unix/utilsunx.cpp diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index 66068411be..41ee69bfc7 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -790,7 +790,13 @@ static bool wxGetHostNameInternal(wxChar *buf, int sz) buf[sz] = wxT('\0'); } #elif defined(HAVE_GETHOSTNAME) - bool ok = gethostname(buf, sz) != -1; + char cbuf[sz]; + bool ok = gethostname(cbuf, sz) != -1; + if ( ok ) + { + wxStrncpy(buf, wxConvertMB2WX(cbuf), sz - 1); + buf[sz] = wxT('\0'); + } #else // no uname, no gethostname wxFAIL_MSG(wxT("don't know host name for this machine"));