X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5c33522fca7cddc441a316f5b9fb50d7685435ba..591cc82deb5bc6dd0af6047ecfa7ce7cf4f8d859:/src/msw/printdlg.cpp diff --git a/src/msw/printdlg.cpp b/src/msw/printdlg.cpp index 46d877613e..c7bc5edb3e 100644 --- a/src/msw/printdlg.cpp +++ b/src/msw/printdlg.cpp @@ -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(devMode->dmDeviceName), + wxStrlcpy(reinterpret_cast(devMode->dmDeviceName), name.wx_str(), - WXSIZEOF(devMode->dmDeviceName) - 1); - devMode->dmDeviceName[WXSIZEOF(devMode->dmDeviceName) - 1] = wxT('\0'); + WXSIZEOF(devMode->dmDeviceName)); } //// Colour @@ -697,7 +696,7 @@ bool wxWindowsPrintDialog::ConvertToNative( wxPrintDialogData &data ) pd->hwndOwner = NULL; pd->hInstance = NULL; - pd->lCustData = NULL; + pd->lCustData = 0; pd->lpfnPrintHook = NULL; pd->lpfnSetupHook = NULL; pd->lpPrintTemplateName = NULL;