From 99dc6723f18f0d0bb95118cf9a7ec991f634a497 Mon Sep 17 00:00:00 2001 From: liuxueli Date: Wed, 5 Aug 2020 14:41:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DIP=E5=BD=92=E5=B1=9E=E5=9C=B0?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E5=AD=97=E6=AE=B5=E5=A1=AB=E5=85=85=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tsg_send_log.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tsg_send_log.cpp b/src/tsg_send_log.cpp index 9f03e05..e6625c7 100644 --- a/src/tsg_send_log.cpp +++ b/src/tsg_send_log.cpp @@ -209,9 +209,9 @@ int set_common_field_from_label(struct tsg_log_instance_t *_instance, struct TLD if(internal_label->client_location!=NULL) { location=internal_label->client_location; - snprintf(buff, sizeof(buff), "%s,%s,%s", (memcmp(location->city_full, "null", 4) ? "" : location->city_full), - (memcmp(location->province_full, "null", 4) ? "" : location->province_full), - (memcmp(location->country_full, "null", 4) ? "" : location->country_full) + snprintf(buff, sizeof(buff), "%s,%s,%s", (!(memcmp(location->city_full, "null", 4)) ? "" : location->city_full), + (!(memcmp(location->province_full, "null", 4)) ? "" : location->province_full), + (!(memcmp(location->country_full, "null", 4)) ? "" : location->country_full) ); TLD_append(_handle, _instance->id2field[LOG_COMMON_CLINET_LOCATION].name, (void *)buff, TLD_TYPE_STRING); } @@ -219,9 +219,9 @@ int set_common_field_from_label(struct tsg_log_instance_t *_instance, struct TLD if(internal_label->server_location!=NULL) { location=internal_label->server_location; - snprintf(buff, sizeof(buff), "%s,%s,%s", (memcmp(location->city_full, "null", 4) ? "" : location->city_full), - (memcmp(location->province_full, "null", 4) ? "" : location->province_full), - (memcmp(location->country_full, "null", 4) ? "" : location->country_full) + snprintf(buff, sizeof(buff), "%s,%s,%s", (!(memcmp(location->city_full, "null", 4)) ? "" : location->city_full), + (!(memcmp(location->province_full, "null", 4)) ? "" : location->province_full), + (!(memcmp(location->country_full, "null", 4)) ? "" : location->country_full) ); TLD_append(_handle, _instance->id2field[LOG_COMMON_SERVER_LOCATION].name, (void *)buff, TLD_TYPE_STRING); }