if the returned 's' is NULL,
it will be crashed at free(s);

    s = elm_entry_utf8_to_markup(path);
-   if (s)
-     {
-        elm_object_text_set(sd->entry, s);
-        free(s);
-     }
+   elm_object_text_set(sd->entry, s);
+   free(s);

 
------------------------------------
-Regards, Hermet- 

-----Original Message-----
From: "Ryuan Choi - Enlightenment Git"<no-re...@enlightenment.org> 
To: <enlightenment-...@lists.sourceforge.net>; 
Cc: 
Sent: 2013-07-18 (목) 02:02:22
Subject: [EGIT] [core/elementary] master 01/01: Remove redundant check routine 
what elm_entry_utf8_to_markup() returns.

ryuan pushed a commit to branch master.

commit f579f7fd4b5e863f01a001876e536f5becc40811
Author: Ryuan Choi <ryuan.choi>@gmail.com>
Date:   Thu Jul 18 01:59:22 2013 +0900

    Remove redundant check routine what elm_entry_utf8_to_markup() returns.
    
    elm_entry_utf8_to_markup() always returns allocated string.
    So, we don't need to check what it returns.
---
 src/lib/elc_fileselector.c        1 -
 src/lib/elc_fileselector_entry.c  8 ++------
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/lib/elc_fileselector.c b/src/lib/elc_fileselector.c
index 3bfc1f8..68b6df1 100644
--- a/src/lib/elc_fileselector.c
+++ b/src/lib/elc_fileselector.c
@@ -227,7 +227,6 @@ _anchors_do(Evas_Object *obj,
    ELM_FILESELECTOR_DATA_GET(obj, sd);
 
    s = elm_entry_utf8_to_markup(path);
-   if (!s) return;
 
    buf[0] = '\0';
    tok = eina_str_split(s, "/", 0);
diff --git a/src/lib/elc_fileselector_entry.c b/src/lib/elc_fileselector_entry.c
index f76f8df..b1e19ed 100644
--- a/src/lib/elc_fileselector_entry.c
+++ b/src/lib/elc_fileselector_entry.c
@@ -79,7 +79,6 @@ _FILE_CHOSEN_fwd(void *data,
    ELM_FILESELECTOR_ENTRY_DATA_GET(data, sd);
 
    s = elm_entry_utf8_to_markup(file);
-   if (!s) return;
    elm_object_text_set(sd->entry, s);
    free(s);
    evas_object_smart_callback_call(data, SIG_FILE_CHOSEN, event_info);
@@ -560,11 +559,8 @@ _path_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
 
    elm_fileselector_button_path_set(sd->button, path);
    s = elm_entry_utf8_to_markup(path);
-   if (s)
-     {
-        elm_object_text_set(sd->entry, s);
-        free(s);
-     }
+   elm_object_text_set(sd->entry, s);
+   free(s);
 }
 
 EAPI const char *

-- 

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to