commit f9bcaf911a9cbd134210aa17d8baedc5886500b4
parent 96a0cb756b27abcce57345e414dbcd394949bd18
Author: Michael Forney <mforney@mforney.org>
Date: Sat, 30 Apr 2016 14:44:57 -0700
Avoid conditional with omitted operand
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/libswc/keyboard.c b/libswc/keyboard.c
@@ -110,8 +110,12 @@ client_handle_modifiers(struct keyboard *keyboard, const struct keyboard_modifie
static bool
update_keymap(struct xkb *xkb)
{
- const char *keymap_directory = getenv("XDG_RUNTIME_DIR") ?: "/tmp";
+ const char *keymap_directory;
char *keymap_string;
+
+ if (!(keymap_directory = getenv("XDG_RUNTIME_DIR")))
+ keymap_directory = "/tmp";
+
char keymap_path[strlen(keymap_directory) + 1 + sizeof keymap_file_template];
xkb->indices.ctrl = xkb_keymap_mod_get_index(xkb->keymap.map, XKB_MOD_NAME_CTRL);