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); }