add safe wxStrlcpy() function and replaced all wxStrncpy() calls by it
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57023 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -412,10 +412,9 @@ bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data )
|
||||
{
|
||||
// NB: the cast is needed in the ANSI build, strangely enough
|
||||
// dmDeviceName is BYTE[] and not char[] there
|
||||
wxStrncpy(reinterpret_cast<wxChar *>(devMode->dmDeviceName),
|
||||
wxStrlcpy(reinterpret_cast<wxChar *>(devMode->dmDeviceName),
|
||||
name.wx_str(),
|
||||
WXSIZEOF(devMode->dmDeviceName) - 1);
|
||||
devMode->dmDeviceName[WXSIZEOF(devMode->dmDeviceName) - 1] = wxT('\0');
|
||||
WXSIZEOF(devMode->dmDeviceName));
|
||||
}
|
||||
|
||||
//// Colour
|
||||
|
Reference in New Issue
Block a user