X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Ftranslate.c;h=210155789927eae576028c6e8af45d421eaa178f;hb=e61f58462fe0cdd85090b621c6906b2885990071;hp=a9ff3e264c0cf774588235766a7d3ebaab42fefe;hpb=31d7680274cdf2fa3c45b8c8d56db2b5d8fbc111;p=chaz%2Fopenbox diff --git a/openbox/translate.c b/openbox/translate.c index a9ff3e26..21015578 100644 --- a/openbox/translate.c +++ b/openbox/translate.c @@ -68,7 +68,7 @@ gboolean translate_button(const gchar *str, guint *state, guint *button) gboolean ret = FALSE; parsed = g_strsplit(str, "-", -1); - + /* first, find the button (last token) */ l = NULL; for (i = 0; parsed[i] != NULL; ++i) @@ -110,7 +110,7 @@ gboolean translate_key(const gchar *str, guint *state, guint *keycode) KeySym sym; parsed = g_strsplit(str, "-", -1); - + /* first, find the key (last token) */ l = NULL; for (i = 0; parsed[i] != NULL; ++i) @@ -145,7 +145,7 @@ gboolean translate_key(const gchar *str, guint *state, guint *keycode) *keycode = XKeysymToKeycode(ob_display, sym); } if (!*keycode) { - g_message(_("Requested key '%s' does not exist on the display"), l); + g_message(_("Requested key '%s' does not exist on the display"), l); goto translation_fail; } @@ -156,7 +156,7 @@ translation_fail: return ret; } -const gchar *translate_keycode(guint keycode) +gchar *translate_keycode(guint keycode) { KeySym sym; const gchar *ret = NULL; @@ -170,7 +170,7 @@ gunichar translate_unichar(guint keycode) { gunichar unikey = 0; - const char *key; + char *key; if ((key = translate_keycode(keycode)) != NULL && /* don't accept keys that aren't a single letter, like "space" */ key[1] == '\0') @@ -179,5 +179,6 @@ gunichar translate_unichar(guint keycode) if (unikey == (gunichar)-1 || unikey == (gunichar)-2 || unikey == 0) unikey = 0; } + g_free(key); return unikey; }