From: @CHENG <2393524978@qq.com> Date: Thu, 9 May 2024 01:42:34 +0000 (+0800) Subject: gengxin X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=8dfa892dae541f046be600c70ba4d7450f3ce000;p=mirrors%2FASR3603_Z5_DS.git gengxin --- diff --git a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_api.c b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_api.c index 96e22aa9..51f4f99b 100644 --- a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_api.c +++ b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_api.c @@ -313,17 +313,17 @@ void mmi_watch_authenticate_action(void) { char * bid = cJSON_GetStringValue(cJSON_GetObjectItem(json_data, "bid")); //PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: bid=%s\n", __FUNCTION__, __LINE__, bid); - if(NULL != bid) + if(NULL != bid && 0 != strlen(bid)) mmi_protocol_device_name_set(bid); char * key = cJSON_GetStringValue(cJSON_GetObjectItem(json_data, "secretKey")); //PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: key=%s\n", __FUNCTION__, __LINE__, key); - if(NULL != key) + if(NULL != key && 0 != strlen(key)) mmi_protocol_md5_key_str_set(key); char * host = cJSON_GetStringValue(cJSON_GetObjectItem(json_data, "host")); //PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: host=%s\n", __FUNCTION__, __LINE__, host); - if(NULL != host) + if(NULL != host && 0 != strlen(host)) mmi_watch_host_name_set(host); int port = cJSON_GetIntValue(cJSON_GetObjectItem(json_data, "port")); @@ -380,7 +380,7 @@ char * mmi_watch_host_name_get(void) void mmi_watch_host_name_set(char * ip_address) { - if(NULL == ip_address) + if(NULL == ip_address || 0 == strlen(ip_address)) return; if(NV_WATCH_HOST_NAME_LEN_MIN > strlen(ip_address) || NV_WATCH_HOST_NAME_LEN_MAX <= strlen(ip_address)) return;