fix possible NULL issues

This commit is contained in:
Boris Faure 2014-03-25 21:49:10 +01:00
parent 0313446e79
commit 00fbb359ee
2 changed files with 8 additions and 4 deletions

View File

@ -379,8 +379,11 @@ _cb_grid_doubleclick(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
{
Config *config = termio_config_get(_term);
char *config_background_dir = ecore_file_dir_get(config->background);
if (!_user_path)
_user_background_dir_init();
if (!_user_path) {
if (!_user_background_dir_init())
return;
}
if (!config->background)
return;
if (strncmp(config_background_dir, _user_path,

View File

@ -1966,7 +1966,8 @@ _smart_cb_key_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
static Eina_Bool
_is_modifier(const char *key)
{
if ((!strncmp(key, "Shift", 5)) ||
if ((key != NULL) && (
(!strncmp(key, "Shift", 5)) ||
(!strncmp(key, "Control", 7)) ||
(!strncmp(key, "Alt", 3)) ||
(!strncmp(key, "Meta", 4)) ||
@ -1974,7 +1975,7 @@ _is_modifier(const char *key)
(!strncmp(key, "Hyper", 5)) ||
(!strcmp(key, "Scroll_Lock")) ||
(!strcmp(key, "Num_Lock")) ||
(!strcmp(key, "Caps_Lock")))
(!strcmp(key, "Caps_Lock"))))
return EINA_TRUE;
return EINA_FALSE;
}