X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0cbb929795f8f37acd1eef923a3d8f48f978d963..a93e536be025cae6ebdae27c940a72ff59c0a006:/src/common/log.cpp 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);