diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/input.c | 9 |
2 files changed, 13 insertions, 1 deletions
@@ -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); |