diff options
author | fvogel <fvogelnew1@free.fr> | 2023-09-03 10:28:40 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2023-09-03 10:28:40 (GMT) |
commit | 015d624b781e75972f17b7325dea3e7f25944e9b (patch) | |
tree | ecb7bf41025c3eef61e3484935c09598450d3864 /generic/tkEvent.c | |
parent | e7b99a7f7b63e38fc8a3dc47b9864776037c5236 (diff) | |
download | tk-015d624b781e75972f17b7325dea3e7f25944e9b.zip tk-015d624b781e75972f17b7325dea3e7f25944e9b.tar.gz tk-015d624b781e75972f17b7325dea3e7f25944e9b.tar.bz2 |
Fix [b305ee09b1]: valgrind reports that Conditional jump or move depends on uninitialised value(s)
Diffstat (limited to 'generic/tkEvent.c')
-rw-r--r-- | generic/tkEvent.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/generic/tkEvent.c b/generic/tkEvent.c index 6ed9ffb..b6ee204 100644 --- a/generic/tkEvent.c +++ b/generic/tkEvent.c @@ -1142,16 +1142,18 @@ Tk_HandleEvent( #if !defined(_WIN32) && !defined(MAC_OSX_TK) - if ((eventPtr->xbutton.button >= Button4) && (eventPtr->xbutton.button < Button8)) { - if (eventPtr->type == ButtonRelease) { - return; - } else if (eventPtr->type == ButtonPress) { - int but = eventPtr->xbutton.button; - eventPtr->type = MouseWheelEvent; - eventPtr->xany.send_event = -1; - eventPtr->xkey.keycode = (but & 1) ? -120 : 120; - if (but > Button5) { - eventPtr->xkey.state |= ShiftMask; + if ((eventPtr->type == ButtonRelease) || (eventPtr->type == ButtonPress)) { + if ((eventPtr->xbutton.button >= Button4) && (eventPtr->xbutton.button < Button8)) { + if (eventPtr->type == ButtonRelease) { + return; + } else { /* eventPtr->type == ButtonPress */ + int but = eventPtr->xbutton.button; + eventPtr->type = MouseWheelEvent; + eventPtr->xany.send_event = -1; + eventPtr->xkey.keycode = (but & 1) ? -120 : 120; + if (but > Button5) { + eventPtr->xkey.state |= ShiftMask; + } } } } |