From cdca4e903603a024d495bdc343a7f397aa7bd14f Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 27 Apr 2019 18:53:59 +0200 Subject: [PATCH] [MSPAINT] Don't use SIZEOF on a pointer Fixes GCC 8 warning: base/applications/mspaint/definitions.h:16:31: error: division 'sizeof (LPWSTR {aka wchar_t*}) / sizeof (WCHAR {aka wchar_t})' does not compute the number of array elements [-Werror=sizeof-pointer-div] #define SIZEOF(a) (sizeof(a) / sizeof((a)[0])) ~~~~~~~~~~^~~~~~~~~~~~~~~~ base/applications/mspaint/main.cpp:134:55: note: in expansion of macro 'SIZEOF' lstrcpyn(pon->lpOFN->lpstrFile, Path, SIZEOF(pon->lpOFN->lpstrFile)); ^~~~~~ --- base/applications/mspaint/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/applications/mspaint/main.cpp b/base/applications/mspaint/main.cpp index 6b0d512cf4e..381b193158b 100644 --- a/base/applications/mspaint/main.cpp +++ b/base/applications/mspaint/main.cpp @@ -131,7 +131,7 @@ OFNHookProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) *pch = 0; FileExtFromFilter(pch, pchTitle, pon->lpOFN); SendMessage(hParent, CDM_SETCONTROLTEXT, 0x047c, (LPARAM)pchTitle); - lstrcpyn(pon->lpOFN->lpstrFile, Path, SIZEOF(pon->lpOFN->lpstrFile)); + lstrcpyn(pon->lpOFN->lpstrFile, Path, pon->lpOFN->nMaxFile); } } break;