From: Dana Jansens Date: Mon, 8 Feb 2010 23:06:16 +0000 (-0500) Subject: fix crash in 3.4 that doesnt show up in work X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=fe14dfe2ddec9302c01d6d3b3f6edf584c4585c4;p=mikachu%2Fopenbox.git fix crash in 3.4 that doesnt show up in work --- diff --git a/openbox/translate.c b/openbox/translate.c index bd8b88f6..71a919cb 100644 --- a/openbox/translate.c +++ b/openbox/translate.c @@ -166,7 +166,11 @@ gchar *translate_keycode(guint keycode) if ((sym = XKeycodeToKeysym(ob_display, keycode, 0)) != NoSymbol) ret = XKeysymToString(sym); - return g_locale_to_utf8(ret, -1, NULL, NULL, NULL); + /* glib crashes in g_locale_to_utf8 if you pass it NULL here */ + if (ret) + return g_locale_to_utf8(ret, -1, NULL, NULL, NULL); + else + return NULL; } gunichar translate_unichar(guint keycode)