fixed a harmless buglet in wxSysErrorMsg() under Win32

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13263 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2001-12-31 02:41:25 +00:00
parent 6415c4fe8a
commit 251244a020

View File

@ -732,11 +732,10 @@ const wxChar *wxSysErrorMsg(unsigned long nErrCode)
0, NULL);
// copy it to our buffer and free memory
if( lpMsgBuf != 0 )
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);
// returned string is capitalized and ended with '\r\n' - bad
@ -747,6 +746,10 @@ const wxChar *wxSysErrorMsg(unsigned long nErrCode)
if ( s_szBuf[len - 2] == wxT('\r') )
s_szBuf[len - 2] = wxT('\0');
}
}
else {
s_szBuf[0] = wxT('\0');
}
return s_szBuf;
#else //Win16