aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorHyleus <31997281+Hyleus@users.noreply.github.com>2018-01-09 19:31:36 +0100
committerBert Münnich <ber.t@posteo.de>2018-01-09 19:31:36 +0100
commit6d261b4e7af3109169edd9ceaeeb5751a01a9596 (patch)
tree2c8047531626da4c35eea0981773cc4fc7fe65e0 /main.c
parent9707ca9b8fc386354a7966f4584a5f7fdbd41e9c (diff)
Fix a potential uninitialized variable
Diffstat (limited to 'main.c')
-rw-r--r--main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/main.c b/main.c
index 5f861df..41ae8b2 100644
--- a/main.c
+++ b/main.c
@@ -575,9 +575,12 @@ void on_keypress(XKeyEvent *kev)
kev->state &= ~ShiftMask;
XLookupString(kev, &key, 1, &shksym, NULL);
kev->state |= ShiftMask;
+ XLookupString(kev, &key, 1, &ksym, NULL);
+ sh = ksym != shksym ? ShiftMask : 0;
+ } else {
+ XLookupString(kev, &key, 1, &ksym, NULL);
+ sh = 0;
}
- XLookupString(kev, &key, 1, &ksym, NULL);
- sh = (kev->state & ShiftMask) && ksym != shksym ? ShiftMask : 0;
if (IsModifierKey(ksym))
return;