From 0ba8380aea441dd1060f9070fc19de05bc5e6007 Mon Sep 17 00:00:00 2001 From: Nick Briggs Date: Wed, 14 Dec 2022 12:38:39 -0800 Subject: [PATCH] Don't reference uninitialized fields in DspInterface when processing window events in no-scroll case. Initialize variables to suppress "may be uninitialized when used here" warning that couldn't actually happen. --- src/xwinman.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/xwinman.c b/src/xwinman.c index 3bcc628..9231e30 100644 --- a/src/xwinman.c +++ b/src/xwinman.c @@ -64,7 +64,7 @@ static inline unsigned ubound(unsigned lower, unsigned value, unsigned upper) void Set_BitGravity(XButtonEvent *event, DspInterface dsp, Window window, int grav) { - Window OldWindow; + Window OldWindow = 0; /* Change Background Pixmap of Gravity Window */ XLOCK; @@ -259,6 +259,7 @@ void process_Xevents(DspInterface dsp) break; default: break; } + else if (noscroll) continue; else if (report.xany.window == dsp->HorScrollBar) switch (report.type) { case ButtonPress: