summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYakov Goldberg <yakov.g@samsung.com>2014-02-24 14:15:46 +0200
committerYakov Goldberg <yakov.g@samsung.com>2014-02-24 14:25:37 +0200
commitf3018a54d9c40fffe60687f020f0acd1e5ea4d87 (patch)
treeebeea0703d4155014c52c5f0371f695f513621a8
parent42f78dfe02ab269bc70d473cd2034f121136cd48 (diff)
menu: add NULL checks to elm_obj_menu_item_add()
Function returns newly created item through last param Elm_Object_Item**. Add checks to make possible to pass NULL, if return is not needed.
-rw-r--r--src/lib/elm_menu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/elm_menu.c b/src/lib/elm_menu.c
index cbbadadfb..7f20f0d97 100644
--- a/src/lib/elm_menu.c
+++ b/src/lib/elm_menu.c
@@ -965,7 +965,7 @@ _item_add(Eo *obj, void *_pd, va_list *list)
965 Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb); 965 Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
966 const void *data = va_arg(*list, const void *); 966 const void *data = va_arg(*list, const void *);
967 Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **); 967 Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
968 *ret = NULL; 968 if (ret) *ret = NULL;
969 969
970 Elm_Menu_Item *it; 970 Elm_Menu_Item *it;
971 Evas_Object *icon_obj; 971 Evas_Object *icon_obj;
@@ -1009,7 +1009,7 @@ _item_add(Eo *obj, void *_pd, va_list *list)
1009 it->dbus_idx = _elm_dbus_menu_item_add(sd->dbus_menu, (Elm_Object_Item *)it); 1009 it->dbus_idx = _elm_dbus_menu_item_add(sd->dbus_menu, (Elm_Object_Item *)it);
1010 it->dbus_menu = sd->dbus_menu; 1010 it->dbus_menu = sd->dbus_menu;
1011 } 1011 }
1012 *ret = (Elm_Object_Item *)it; 1012 if (ret) *ret = (Elm_Object_Item *)it;
1013} 1013}
1014 1014
1015EAPI unsigned int 1015EAPI unsigned int