]> git.saurik.com Git - wxWidgets.git/commitdiff
minor fix that was part of helpbest.patch
authorVáclav Slavík <vslavik@fastmail.fm>
Thu, 30 Aug 2001 23:25:56 +0000 (23:25 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Thu, 30 Aug 2001 23:25:56 +0000 (23:25 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11521 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

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);