]> git.saurik.com Git - wxWidgets.git/commitdiff
fix for unicode build
authorRobin Dunn <robin@alldunn.com>
Thu, 9 Nov 2006 20:01:55 +0000 (20:01 +0000)
committerRobin Dunn <robin@alldunn.com>
Thu, 9 Nov 2006 20:01:55 +0000 (20:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43233 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/unix/utilsunx.cpp

index 66068411bebc02b89c219ba63dae9abd0bc8b737..41ee69bfc76732ce711af087a9c8af8173ba70e2 100644 (file)
@@ -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"));