]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/log.cpp
don't try to translate the standard encoding names
[wxWidgets.git] / src / common / log.cpp
index d20aa9b6dd4478c9d91961db4abce0257fb3ef8f..be03d3c4c8b3a9e12f476e81d01dc663801b6cb9 100644 (file)
@@ -732,7 +732,10 @@ const wxChar *wxSysErrorMsg(unsigned long nErrCode)
             0, NULL);
 
     // copy it to our buffer and free memory
-    wxStrncpy(s_szBuf, (const wxChar *)lpMsgBuf, WXSIZEOF(s_szBuf) - 1);
+    if( lpMsgBuf != 0 )
+        wxStrncpy(s_szBuf, (const wxChar *)lpMsgBuf, WXSIZEOF(s_szBuf) - 1);
+    else
+        s_szBuf[0] = wxT('\0');
     s_szBuf[WXSIZEOF(s_szBuf) - 1] = wxT('\0');
     LocalFree(lpMsgBuf);