summaryrefslogtreecommitdiff
path: root/src/input.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2002-01-15 18:50:42 +0000
committersabetts <sabetts>2002-01-15 18:50:42 +0000
commit7a0ed875f709d0f32b7a1b3f61bcefdc0da9e403 (patch)
tree69dcefd5ec23a5ce19bf62888f6839c198c47241 /src/input.c
parentf92fdee896fa396680b994b709d6ac775636a44c (diff)
downloadratpoison-7a0ed875f709d0f32b7a1b3f61bcefdc0da9e403.zip
fixed crash on solaris
Diffstat (limited to 'src/input.c')
-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);