diff options
| author | liuxueli <[email protected]> | 2020-08-05 14:41:14 +0800 |
|---|---|---|
| committer | liuxueli <[email protected]> | 2020-08-05 14:41:14 +0800 |
| commit | 99dc6723f18f0d0bb95118cf9a7ec991f634a497 (patch) | |
| tree | 167b2688ef14445c06001c20583065ee89ea08b4 | |
| parent | d38b1b68b4758adce2824250457275f0a39569eb (diff) | |
修复IP归属地日志字段填充错误v3.1.1.20.08
| -rw-r--r-- | src/tsg_send_log.cpp | 12 |
1 files 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); } |
