]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/sckaddr.cpp
gcc warning about printf() format mismatch corrected
[wxWidgets.git] / src / common / sckaddr.cpp
index 1e126d81afc988d951dd6d5855648791295f187e..fff40bef7ddae9e2cec462773dd72225a51bee00 100644 (file)
@@ -32,6 +32,7 @@
 
 #include <wx/defs.h>
 #include <wx/object.h>
+#include <wx/log.h>
 #include <wx/gsocket.h>
 #include <wx/sckaddr.h>
 
@@ -101,6 +102,12 @@ wxIPV4address::~wxIPV4address()
 
 bool wxIPV4address::Hostname(const wxString& name)
 {
+  // Some people are sometimes fool.
+  if (name == wxT("")) {
+    wxLogWarning( wxT("Trying to solve a NULL hostname: giving up") );
+    return FALSE;
+  }
+
   return (GAddress_INET_SetHostName(m_address, name.fn_str()) == GSOCK_NOERROR);
 }