Using right country code

This commit is contained in:
2020-12-29 17:13:47 +01:00
parent f1064692a8
commit 75ef4110c8

View File

@ -500,8 +500,10 @@ int client_connection_handler(sock *client, unsigned long client_num) {
free(client_geoip);
client_geoip = NULL;
} else {
char *pos = strstr(client_geoip, "\"iso_code\":\"");
char *pos = client_geoip;
pos = strstr(pos, "\"country\":");
if (pos != NULL) {
pos = strstr(pos, "\"iso_code\":");
pos += 12;
strncpy(client_cc, pos, 2);
}