diff --git a/common/src/tfe_scan.cpp b/common/src/tfe_scan.cpp index aa3feb5..d743cf4 100644 --- a/common/src/tfe_scan.cpp +++ b/common/src/tfe_scan.cpp @@ -186,14 +186,7 @@ int tfe_scan_ip_location(const struct tfe_stream *stream, struct Maat_rule_t *re { memset(buff, 0, sizeof(buff)); - if(strlen(dst_subdivsion)) - { - snprintf(buff, sizeof(buff),"%s.%s.%s.%s.", dst_country, dst_provine, dst_city, dst_subdivsion); - } - else - { - snprintf(buff, sizeof(buff), "%s.%s.", dst_country, dst_city); - } + snprintf(buff, sizeof(buff),"%s.%s.%s.%s.", dst_country, dst_provine, dst_city, dst_subdivsion); scan_ret = Maat_full_scan_string(tfe_bussiness_resouce_get(STATIC_MAAT), tfe_bussiness_tableid_get(TABLE_SECURITY_DESTINATION_LOCATION), CHARSET_GBK, buff, strlen(buff), result + hit_cnt + hit_cnt_ip, NULL, MAX_SCAN_RESULT - hit_cnt - hit_cnt_ip, @@ -223,14 +216,8 @@ int tfe_scan_ip_location(const struct tfe_stream *stream, struct Maat_rule_t *re if (strlen(src_country) || strlen(src_city)) { memset(buff, 0, sizeof(buff)); - if(strlen(src_subdivsion)) - { - snprintf(buff, sizeof(buff), "%s.%s.%s.%s.", src_country, src_provine, src_city, src_subdivsion); - } - else - { - snprintf(buff, sizeof(buff), "%s.%s.", src_country, src_city); - } + + snprintf(buff, sizeof(buff), "%s.%s.%s.%s.", src_country, src_provine, src_city, src_subdivsion); scan_ret = Maat_full_scan_string(tfe_bussiness_resouce_get(STATIC_MAAT), tfe_bussiness_tableid_get(TABLE_SECURITY_SOURCE_LOCATION), CHARSET_GBK, buff, strlen(buff), result + hit_cnt + hit_cnt_ip, NULL, MAX_SCAN_RESULT - hit_cnt - hit_cnt_ip,