summaryrefslogtreecommitdiff
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
parentf92fdee896fa396680b994b709d6ac775636a44c (diff)
downloadratpoison-7a0ed875f709d0f32b7a1b3f61bcefdc0da9e403.zip
fixed crash on solaris
-rw-r--r--ChangeLog5
-rw-r--r--src/input.c9
2 files changed, 13 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 5ae55d0..995697b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-01-15 Shawn Betts <sabetts@sfu.ca>
+
+ * src/input.c (keysym_to_string): handle the case when
+ XKeysymToString returns NULL.
+
2002-01-11 shawn <sabetts@vcn.bc.ca>
* src/main.c (handler): store the error text at the beginning of
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);