From: Václav Slavík Date: Thu, 30 Aug 2001 23:25:56 +0000 (+0000) Subject: minor fix that was part of helpbest.patch X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/8c5b1f0faff5b26bc9b2d9052069e951e7b41c74 minor fix that was part of helpbest.patch git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11521 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/log.cpp b/src/common/log.cpp index d20aa9b6dd..be03d3c4c8 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -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);