Fix buffer size for call of function GetWindowText

Cppcheck found this issue: Multiplying sizeof() with sizeof() indicates a logic error.
GetWindowText expects the number of characters (3. argument) that fit into the buffer (2. argument).
So a division seems to be correct here instead of a multiplication.
This commit is contained in:
Sebastian 2018-03-13 12:50:59 +01:00 committed by GitHub
parent bb695bb256
commit 50e743d80f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -83,7 +83,7 @@ UINT CAShutdownBOINCManager::OnExecution()
hWndBOINCManagerSystray = FindWindow( _T("wxTaskBarExWindowClass"), _T("BOINCManagerSystray") );
if ( NULL != hWndBOINCManagerSystray )
{
GetWindowText( hWndBOINCManagerSystray, szWindowTitle, (sizeof(szWindowTitle) * sizeof(TCHAR)));
GetWindowText( hWndBOINCManagerSystray, szWindowTitle, (sizeof(szWindowTitle) / sizeof(TCHAR)));
LogProgress( szWindowTitle );
lrReturnValue = SendMessage( hWndBOINCManagerSystray, WM_TASKBARSHUTDOWN, NULL, NULL );