From 8c5b1f0faff5b26bc9b2d9052069e951e7b41c74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Thu, 30 Aug 2001 23:25:56 +0000 Subject: [PATCH] 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 --- src/common/log.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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);