summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyuan Choi <ryuan.choi@gmail.com>2014-01-16 04:27:47 +0900
committerRyuan Choi <ryuan.choi@gmail.com>2014-01-16 04:41:18 +0900
commit5aa098c257b1538b1c6a5f5f2a24c4e1d6ce3f59 (patch)
treeda4e4e9b12deb4fd2f137bb9d946b0f459b21965
parent1c1f95454c878332cc6aa61b43274f747ad22ae2 (diff)
panel: Guarantee the integrity of parameter
- Check whether ret is NULL. - Guarantee hidden variable is only EINA_TRUE or EINA_FALSE.
-rw-r--r--src/lib/elm_panel.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/elm_panel.c b/src/lib/elm_panel.c
index 4e43b7d1f..af9672b99 100644
--- a/src/lib/elm_panel.c
+++ b/src/lib/elm_panel.c
@@ -313,6 +313,8 @@ _elm_panel_smart_content_get(Eo *obj, void *_pd, va_list *list)
313 Elm_Panel_Smart_Data *sd = _pd; 313 Elm_Panel_Smart_Data *sd = _pd;
314 const char *part = va_arg(*list, const char *); 314 const char *part = va_arg(*list, const char *);
315 Evas_Object **ret = va_arg(*list, Evas_Object **); 315 Evas_Object **ret = va_arg(*list, Evas_Object **);
316 if (!ret) return;
317
316 *ret = NULL; 318 *ret = NULL;
317 319
318 if (part && strcmp(part, "default")) 320 if (part && strcmp(part, "default"))
@@ -492,7 +494,7 @@ _orient_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
492 Elm_Panel_Orient *ret = va_arg(*list, Elm_Panel_Orient *); 494 Elm_Panel_Orient *ret = va_arg(*list, Elm_Panel_Orient *);
493 Elm_Panel_Smart_Data *sd = _pd; 495 Elm_Panel_Smart_Data *sd = _pd;
494 496
495 *ret = sd->orient; 497 if (ret) *ret = sd->orient;
496} 498}
497 499
498EAPI void 500EAPI void
@@ -509,7 +511,7 @@ _hidden_set(Eo *obj, void *_pd, va_list *list)
509 Eina_Bool hidden = va_arg(*list, int); 511 Eina_Bool hidden = va_arg(*list, int);
510 Elm_Panel_Smart_Data *sd = _pd; 512 Elm_Panel_Smart_Data *sd = _pd;
511 513
512 if (sd->hidden == hidden) return; 514 if (sd->hidden == !!hidden) return;
513 515
514 _panel_toggle(NULL, obj, NULL, NULL); 516 _panel_toggle(NULL, obj, NULL, NULL);
515} 517}
@@ -529,7 +531,7 @@ _hidden_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
529 Eina_Bool *ret = va_arg(*list, Eina_Bool *); 531 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
530 Elm_Panel_Smart_Data *sd = _pd; 532 Elm_Panel_Smart_Data *sd = _pd;
531 533
532 *ret = sd->hidden; 534 if (ret) *ret = sd->hidden;
533} 535}
534 536
535EAPI void 537EAPI void