windowctrl-win : use std::array instead of c-style array

This commit is contained in:
Tobias Ludwig
2020-03-17 19:27:10 +01:00
parent 5a4abc39aa
commit 63ef80adab

View File

@@ -8,6 +8,11 @@
#include <tlhelp32.h>
#include <CommCtrl.h>
/*
* Standard library includes
*/
#include <array>
/*
* Qt includes
*/
@@ -87,9 +92,9 @@ bool WindowCtrlWin::findWindow( const QString& title )
*/
BOOL CALLBACK WindowCtrlWin::enumWindowsTitleProc( HWND hwnd, LPARAM lParam )
{
char buffer[ 128 ];
int written = GetWindowTextA( hwnd, buffer, 128 );
if( written && strstr( buffer, (char*)lParam ) != nullptr )
std::array<char, 128> buffer;
int written = GetWindowTextA( hwnd, buffer.data(), int(buffer.size()) );
if( written && strstr( buffer.data(), (char*)lParam ) != nullptr )
{
m_tb_windows.append( (quint64)hwnd );
}