diff --git a/src/interactivity/win32/SystemConfigurationProvider.cpp b/src/interactivity/win32/SystemConfigurationProvider.cpp index af37c4c5cd9..0e3dbb790ab 100644 --- a/src/interactivity/win32/SystemConfigurationProvider.cpp +++ b/src/interactivity/win32/SystemConfigurationProvider.cpp @@ -174,9 +174,9 @@ void SystemConfigurationProvider::GetSettingsFromLink( const DWORD dwLinkLen = SearchPathW(pwszCurrDir, pwszAppName, nullptr, ARRAYSIZE(wszIconLocation), wszIconLocation, nullptr); // If we cannot find the application in the path, then try to fall back and see if the window title is a valid path and use that. - if (dwLinkLen <= 0 || dwLinkLen > sizeof(wszIconLocation)) + if (dwLinkLen <= 0 || dwLinkLen > ARRAYSIZE(wszIconLocation)) { - if (PathFileExistsW(pwszTitle) && (wcslen(pwszTitle) < sizeof(wszIconLocation))) + if (PathFileExistsW(pwszTitle) && (wcslen(pwszTitle) < ARRAYSIZE(wszIconLocation))) { StringCchCopyW(wszIconLocation, ARRAYSIZE(wszIconLocation), pwszTitle); }