Fix NULL dereference by clang (thanks to Luis Felipe).

SVN revision: 38834
This commit is contained in:
Gustavo Sverzut Barbieri 2009-01-28 21:13:34 +00:00
parent 691a489728
commit 5e4929a1cf
1 changed files with 4 additions and 2 deletions

View File

@ -765,8 +765,10 @@ _update_mouse_binding_list(E_Config_Dialog_Data *cfdata)
button = _helper_button_name_get(eb);
mods = _helper_modifier_name_get(eb->modifiers);
snprintf(label, sizeof(label), "%s%s%s", button ? button : "", mods[0] ? " + ": "",
mods ? mods : "");
if (mods && mods[0])
snprintf(label, sizeof(label), "%s + %s", button ? button : "", mods);
else
snprintf(label, sizeof(label), "%s", button ? button : "");
if (button) free(button);
if (mods) free(mods);