summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vmod.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/vmod.c b/vmod.c
index af71704..97448c0 100644
--- a/vmod.c
+++ b/vmod.c
@@ -226,13 +226,14 @@ LookupVModMask(XPointer priv,
int
FindKeypadVMod(XkbDescPtr xkb)
{
- Atom name;
- ExprResult rtrn;
+ if (xkb) {
+ Atom name = XkbInternAtom(xkb->dpy, "NumLock", False);
+ ExprResult rtrn;
- name = XkbInternAtom(xkb->dpy, "NumLock", False);
- if ((xkb) && LookupVModIndex((XPointer) xkb, None, name, TypeInt, &rtrn))
- {
- return rtrn.ival;
+ if (LookupVModIndex((XPointer) xkb, None, name, TypeInt, &rtrn))
+ {
+ return rtrn.ival;
+ }
}
return -1;
}