From f91e6d037e6cd5ff3b88056465c47fadaa38dab5 Mon Sep 17 00:00:00 2001 From: Francis Beaudet Date: Thu, 25 Mar 1999 13:22:42 +0000 Subject: [PATCH] Fixed possible endless loop. --- windows/dialog.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/windows/dialog.c b/windows/dialog.c index cfc1bb76265..bd52d8985f5 100644 --- a/windows/dialog.c +++ b/windows/dialog.c @@ -1045,11 +1045,12 @@ static BOOL DIALOG_IsAccelerator( HWND hwnd, HWND hwndDlg, WPARAM vKey ) do { wndPtr = WIN_FindWndPtr( hwndControl ); - if (wndPtr != NULL && wndPtr->text != NULL && - (wndPtr->dwStyle & (WS_VISIBLE | WS_DISABLED)) == WS_VISIBLE) + if ( (wndPtr != NULL) && + ((wndPtr->dwStyle & (WS_VISIBLE | WS_DISABLED)) == WS_VISIBLE) ) { 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 */ LPSTR p = wndPtr->text - 2;