From e76d8fe828ae4f4aa01108bc6486be7fecd49ad9 Mon Sep 17 00:00:00 2001 From: Priya Kohli Date: Wed, 21 Jun 2017 10:59:26 +0530 Subject: [PATCH] Fix for crash if we select "Enter Manually" in IP Setting, press Cancel. Goto Wired Tab Select New Network Button. Change-Id: I55efb78ee4c73c936680e45f776fed582504aec2 Signed-off-by: Priya Kohli --- src/view/view_new_network.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/view/view_new_network.c b/src/view/view_new_network.c index b7549e7..595b786 100644 --- a/src/view/view_new_network.c +++ b/src/view/view_new_network.c @@ -36,6 +36,7 @@ #define DEFAULT_KEYPAD_POS 636 #define PADDING_VKEYBOARD 30 #define IPV4_ADDRESS_MAX_LEN 16 +#define DEFAULT_ADDRESS "000.000.000.000" enum object_type { EO_BTN_AUTOMATIC = 0, @@ -112,7 +113,7 @@ static struct _ip_config_values { char address_subnet[IPV4_ADDRESS_MAX_LEN]; char address_gateway[IPV4_ADDRESS_MAX_LEN]; char address_dns[IPV4_ADDRESS_MAX_LEN]; -} _config_values; +} _config_values = {0, 0, DEFAULT_ADDRESS, DEFAULT_ADDRESS, DEFAULT_ADDRESS, DEFAULT_ADDRESS}; static bool _update_entry_input_state(struct _priv *priv); static void _set_default_config_values(struct _priv *priv); @@ -1074,7 +1075,7 @@ static input_handler _dnsconfig_type_option_input_handler = { static void _set_default_config_values(struct _priv *priv) { SETTING_TRACE_BEGIN; - char *address = "000.000.000.000"; + char *address = NULL; char **ip_text = NULL; struct _content_manual *content = priv->content_manual; @@ -1117,8 +1118,7 @@ static void _set_default_config_values(struct _priv *priv) elm_entry_entry_set(content->dns_ip2, ip_text[1]); elm_entry_entry_set(content->dns_ip3, ip_text[2]); elm_entry_entry_set(content->dns_ip4, ip_text[3]); - } - else { + } else { /* DNS address entry */ ip_text = g_strsplit(_config_values.address_dns, ".", 5); elm_entry_entry_set(content->dns_ip1, ip_text[0]); @@ -1128,8 +1128,7 @@ static void _set_default_config_values(struct _priv *priv) } if(strcmp(address, "000.000.000.000")) free(address); - } - else { + } else { /* IP address entry */ ip_text = g_strsplit(_config_values.address_ip, ".", 5); elm_entry_entry_set(content->ip1, ip_text[0]); -- 2.7.4