Fixed possible endless loop.

This commit is contained in:
Francis Beaudet 1999-03-25 13:22:42 +00:00 committed by Alexandre Julliard
parent 8730e4572d
commit f91e6d037e
1 changed files with 4 additions and 3 deletions

View File

@ -1045,11 +1045,12 @@ static BOOL DIALOG_IsAccelerator( HWND hwnd, HWND hwndDlg, WPARAM vKey )
do do
{ {
wndPtr = WIN_FindWndPtr( hwndControl ); wndPtr = WIN_FindWndPtr( hwndControl );
if (wndPtr != NULL && wndPtr->text != NULL && if ( (wndPtr != NULL) &&
(wndPtr->dwStyle & (WS_VISIBLE | WS_DISABLED)) == WS_VISIBLE) ((wndPtr->dwStyle & (WS_VISIBLE | WS_DISABLED)) == WS_VISIBLE) )
{ {
dlgCode = SendMessageA( hwndControl, WM_GETDLGCODE, 0, 0 ); dlgCode = SendMessageA( hwndControl, WM_GETDLGCODE, 0, 0 );
if (dlgCode & (DLGC_BUTTON | DLGC_STATIC)) if ( (dlgCode & (DLGC_BUTTON | DLGC_STATIC)) &&
(wndPtr->text!=NULL))
{ {
/* find the accelerator key */ /* find the accelerator key */
LPSTR p = wndPtr->text - 2; LPSTR p = wndPtr->text - 2;