summaryrefslogtreecommitdiffstats
path: root/generic/tkEvent.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2023-09-03 10:28:40 (GMT)
committerfvogel <fvogelnew1@free.fr>2023-09-03 10:28:40 (GMT)
commit015d624b781e75972f17b7325dea3e7f25944e9b (patch)
treeecb7bf41025c3eef61e3484935c09598450d3864 /generic/tkEvent.c
parente7b99a7f7b63e38fc8a3dc47b9864776037c5236 (diff)
downloadtk-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.c22
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;
+ }
}
}
}