projects
/
suckless
/
slstatus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6f01174
)
keyboard_indicators: fix segfault when -s is specified
author
Ali H. Fardan
<raiz@firemail.cc>
Sat, 12 Aug 2017 04:01:13 +0000
(07:01 +0300)
committer
Aaron Marcher
<me@drkhsh.at>
Sat, 12 Aug 2017 10:50:11 +0000
(12:50 +0200)
slstatus.c
patch
|
blob
|
history
diff --git
a/slstatus.c
b/slstatus.c
index 47bd4c9926000177f36dee315274af958d6d6e8c..aa05cd1e59089a369235eb6601bc4361198607bc 100644
(file)
--- a/
slstatus.c
+++ b/
slstatus.c
@@
-380,9
+380,15
@@
kernel_release(void)
static const char *
keyboard_indicators(void)
{
+ Display *dpy = XOpenDisplay(NULL);
XKeyboardState state;
+ if (dpy == NULL) {
+ warnx("XOpenDisplay failed");
+ return UNKNOWN_STR;
+ }
XGetKeyboardControl(dpy, &state);
+ XCloseDisplay(dpy);
switch (state.led_mask) {
case 1: