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