From 5cc5b43d0f66ac05a2d31ac6557644769578e981 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 29 Aug 2018 10:59:24 +0200 Subject: Remove some misplaced sizeof() scalings on array sizes for new[] Noticed during review of clang-tidy warnings. I have searched the source tree (using grep) and only this one file contains examples of this mistake. Change-Id: I3bbcec736e5a184db7251962fd3671a21ab5d238 Reviewed-by: Friedemann Kleint Reviewed-by: Andy Shaw --- src/plugins/printsupport/windows/qwindowsprintdevice.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/plugins/printsupport/windows') diff --git a/src/plugins/printsupport/windows/qwindowsprintdevice.cpp b/src/plugins/printsupport/windows/qwindowsprintdevice.cpp index 071bc01192..f01e93d611 100644 --- a/src/plugins/printsupport/windows/qwindowsprintdevice.cpp +++ b/src/plugins/printsupport/windows/qwindowsprintdevice.cpp @@ -210,7 +210,7 @@ void QWindowsPrintDevice::loadPageSizes() const && DeviceCapabilities((LPWSTR)m_id.utf16(), NULL, DC_PAPERS, NULL, NULL) == paperCount) { QScopedArrayPointer paperNames(new wchar_t[paperCount*64]); - QScopedArrayPointer winSizes(new POINT[paperCount*sizeof(POINT)]); + QScopedArrayPointer winSizes(new POINT[paperCount]); QScopedArrayPointer papers(new wchar_t[paperCount]); // Get the details and match the default paper size @@ -356,7 +356,7 @@ void QWindowsPrintDevice::loadInputSlots() const if (int(binCount) > 0 && DeviceCapabilities(printerId, nullptr, DC_BINNAMES, nullptr, nullptr) == binCount) { - QScopedArrayPointer bins(new WORD[binCount*sizeof(WORD)]); + QScopedArrayPointer bins(new WORD[binCount]); QScopedArrayPointer binNames(new wchar_t[binCount*24]); // Get the details and match the default paper size -- cgit v1.2.3