X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dc874fb4cebf75d39cc97210e0f4b6a35403e4a6..bfad4a154618ba95472ccb6ebdd3aa9829c0ecd8:/src/common/log.cpp diff --git a/src/common/log.cpp b/src/common/log.cpp index d6041c195e..9e64eaa9b8 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -1068,8 +1068,7 @@ const wxChar *wxSysErrorMsg(unsigned long nErrCode) #if !defined(__SMARTPHONE__) /* of WinCE */ if( lpMsgBuf != 0 ) { - wxStrncpy(s_szBuf, (const wxChar *)lpMsgBuf, WXSIZEOF(s_szBuf) - 1); - s_szBuf[WXSIZEOF(s_szBuf) - 1] = wxS('\0'); + wxStrlcpy(s_szBuf, (const wxChar *)lpMsgBuf, WXSIZEOF(s_szBuf)); LocalFree(lpMsgBuf);