Xinqi Bao's Git

swap.c: Refactor getstats() and its usage
[slstatus.git] / components / keyboard_indicators.c
index ed4bc17..73ba32e 100644 (file)
@@ -11,20 +11,20 @@ keyboard_indicators(void)
        XKeyboardState state;
 
        if (!(dpy = XOpenDisplay(NULL))) {
-               fprintf(stderr, "Cannot open display\n");
+               warn("XOpenDisplay: Failed to open display");
                return NULL;
        }
        XGetKeyboardControl(dpy, &state);
        XCloseDisplay(dpy);
 
        switch (state.led_mask) {
-               case 1:
-                       return "c";
-               case 2:
-                       return "n";
-               case 3:
-                       return "cn";
-               default:
-                       return "";
+       case 1:
+               return "c";
+       case 2:
+               return "n";
+       case 3:
+               return "cn";
+       default:
+               return "";
        }
 }