ANSI mode compilation fix

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52810 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-03-25 13:33:35 +00:00
parent d0d7f20728
commit 47af39fbf4

View File

@@ -420,7 +420,10 @@ bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data )
wxString name = data.GetPrinterName();
if (!name.empty())
{
wxStrncpy(devMode->dmDeviceName, name.wx_str(),
// NB: the cast is needed in the ANSI build, strangely enough
// dmDeviceName is BYTE[] and not char[] there
wxStrncpy(wx_static_cast(wxChar *, devMode->dmDeviceName),
name.wx_str(),
WXSIZEOF(devMode->dmDeviceName) - 1);
devMode->dmDeviceName[WXSIZEOF(devMode->dmDeviceName) - 1] = wxT('\0');
}