[PATCH] winex11.drv: Assertion was 1 off (Coverity)

Marcus Meissner marcus at jet.franken.de
Sun May 1 07:51:29 CDT 2011


Hi,

<= should have been < here. Get rid of magic constant too.

Ciao, Marcus
---
 dlls/winex11.drv/event.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index acaf49c..2a339d0 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -190,7 +190,7 @@ static inline void free_event_data( XEvent *event )
  */
 void X11DRV_register_event_handler( int type, x11drv_event_handler handler, const char *name )
 {
-    assert( type <= MAX_EVENT_HANDLERS );
+    assert( type < sizeof(handlers)/sizeof(handlers[0]) );
     assert( !handlers[type] || handlers[type] == handler );
     handlers[type] = handler;
     event_names[type] = name;
-- 
1.7.3.4



More information about the wine-patches mailing list