From 6d261b4e7af3109169edd9ceaeeb5751a01a9596 Mon Sep 17 00:00:00 2001 From: Hyleus <31997281+Hyleus@users.noreply.github.com> Date: Tue, 9 Jan 2018 19:31:36 +0100 Subject: Fix a potential uninitialized variable --- main.c | 7 +++++-- 1 file 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; -- cgit v1.2.3