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
This commit is contained in:
Václav Slavík 2001-08-30 23:25:56 +00:00
parent 619e52bf45
commit 8c5b1f0faf

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