summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/input.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/input.c b/src/input.c
index bd264c1..b0ae865 100644
--- a/src/input.c
+++ b/src/input.c
@@ -199,6 +199,7 @@ grab_key (int keycode, unsigned int modifiers, Window grab_window)
char *
keysym_to_string (KeySym keysym, unsigned int modifier)
{
+ static char *null_string = "NULL"; /* A NULL string. */
struct sbuf *name;
char *tmp;
@@ -210,7 +211,13 @@ keysym_to_string (KeySym keysym, unsigned int modifier)
if (modifier & RP_HYPER_MASK) sbuf_concat (name, "H-");
if (modifier & RP_SUPER_MASK) sbuf_concat (name, "S-");
- sbuf_concat (name, XKeysymToString (keysym));
+ /* On solaris machines (perhaps other machines as well) this call
+ can return NULL. In this case use the "NULL" string. */
+ tmp = XKeysymToString (keysym);
+ if (tmp == NULL)
+ tmp = null_string;
+
+ sbuf_concat (name, tmp);
/* Eat the nut and throw away the shells. */
tmp = sbuf_get (name);