diff options
author | Haru <haru@dotalux.com> | 2019-10-20 17:43:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-20 17:43:44 +0200 |
commit | 275edef51c858e9e55934ec3af92ec19db74f3d3 (patch) | |
tree | 81c4367dfb4d51fec9c71c2a407f502a514b6a67 /src/char/geoip.c | |
parent | ddd0e461fb8e451912a6aee90869023e2c2d8272 (diff) | |
parent | be955e59bcd950d6430189a8a23a608927665c02 (diff) | |
download | hercules-275edef51c858e9e55934ec3af92ec19db74f3d3.tar.gz hercules-275edef51c858e9e55934ec3af92ec19db74f3d3.tar.bz2 hercules-275edef51c858e9e55934ec3af92ec19db74f3d3.tar.xz hercules-275edef51c858e9e55934ec3af92ec19db74f3d3.zip |
Merge pull request #2547 from guilherme-gm/201910-dehardcode-db
Dehardcode DB files path
Diffstat (limited to 'src/char/geoip.c')
-rw-r--r-- | src/char/geoip.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/char/geoip.c b/src/char/geoip.c index 2870e5f0c..67c057aff 100644 --- a/src/char/geoip.c +++ b/src/char/geoip.c @@ -23,6 +23,7 @@ #include "geoip.h" #include "common/cbasetypes.h" +#include "common/conf.h" #include "common/memmgr.h" #include "common/showmsg.h" @@ -141,7 +142,9 @@ static void geoip_init(void) geoip->data->active = true; - db = fopen("./db/GeoIP.dat","rb"); + char file_path[256]; + libconfig->format_db_path("GeoIP.dat", file_path, sizeof(file_path)); + db = fopen(file_path, "rb"); if (db == NULL) { ShowError("geoip_readdb: Error reading GeoIP.dat!\n"); geoip->final(false); |