Split entry_text only when it is valid 82/258482/2
authorCheoleun Moon <chleun.moon@samsung.com>
Tue, 18 May 2021 10:00:12 +0000 (19:00 +0900)
committercheoleun moon <chleun.moon@samsung.com>
Thu, 20 May 2021 05:18:42 +0000 (05:18 +0000)
Change-Id: Id16707ba4f387477a108becedc12afde0e7541e7
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
common/common_ip_info.c

index b3f76e6..d64f987 100644 (file)
@@ -395,7 +395,6 @@ static void _ip_info_entry_changed_cb(void *data,
                char entry_ip_text[16] = { 0, };
                gboolean fixed = FALSE;
                entry_text = elm_entry_markup_to_utf8(elm_entry_entry_get(obj));
-               ip_text = g_strsplit(entry_text, ".", 5);
 
                if (entry_text == NULL || entry_text[0] == '\0') {
                        if (entry_info->entry_txt) {
@@ -407,6 +406,7 @@ static void _ip_info_entry_changed_cb(void *data,
                        g_free(entry_text);
                        entry_text = NULL;
                } else {
+                       ip_text = g_strsplit(entry_text, ".", 5);
                        for (i = 0; i < 5; i++) {
                                if (ip_text[i] == NULL)
                                        break;