summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShilpa Singh <shilpa.singh@samsung.com>2016-02-12 21:13:02 +0100
committerCedric BAIL <cedric@osg.samsung.com>2016-02-12 21:13:06 +0100
commitfbcd2a561fb277805b903468e1996acc15ad63e3 (patch)
treecdf2bea8980e756418125d5bd19fcdea52e4cf68
parentcbbf08b4ed1157efaa1597cad798fb506c1853a8 (diff)
spinner: crash on illegal format set issue fix.
Summary: Set any illegal format, spinner crashes, the format set to spinner has to be valid hence a check is added initially itself to check for validity of label formats. Signed-off-by: Shilpa Singh <shilpa.singh@samsung.com> Test Plan: 1. Set illegal format to spinner for e.g: elm_spinner_label_format_set(sp, "d"); 2. Run spinner demo Crash is observed Reviewers: cedric Subscribers: govi, buds Differential Revision: https://phab.enlightenment.org/D3668 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/lib/elm_spinner.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/elm_spinner.c b/src/lib/elm_spinner.c
index 0e94cf119..252bb8d1d 100644
--- a/src/lib/elm_spinner.c
+++ b/src/lib/elm_spinner.c
@@ -1348,6 +1348,12 @@ _elm_spinner_eo_base_constructor(Eo *obj, Elm_Spinner_Data *_pd EINA_UNUSED)
1348EOLIAN static void 1348EOLIAN static void
1349_elm_spinner_label_format_set(Eo *obj, Elm_Spinner_Data *sd, const char *fmt) 1349_elm_spinner_label_format_set(Eo *obj, Elm_Spinner_Data *sd, const char *fmt)
1350{ 1350{
1351 if (!strchr(fmt, '%'))
1352 {
1353 WRN("Warning: %s is an Illegal format, cannot be set", fmt);
1354 return;
1355 }
1356
1351 eina_stringshare_replace(&sd->label, fmt); 1357 eina_stringshare_replace(&sd->label, fmt);
1352 1358
1353 if (fmt && !(_is_label_format_integer(sd->label))) 1359 if (fmt && !(_is_label_format_integer(sd->label)))