diff options
author | Guilherme Menaldo <guilherme.menaldo@outlook.com> | 2019-10-01 22:57:09 -0300 |
---|---|---|
committer | Guilherme Menaldo <guilherme.menaldo@outlook.com> | 2019-10-05 16:42:54 -0300 |
commit | 7d25827001493a82a8f75cfc6a0b956164b44f05 (patch) | |
tree | 911eff2691b6804c6a971bd86234313ee1af7dcf /src/char/geoip.c | |
parent | d026e28fd78f60dfa21da381f17f2a8cc9ae3d11 (diff) | |
download | hercules-7d25827001493a82a8f75cfc6a0b956164b44f05.tar.gz hercules-7d25827001493a82a8f75cfc6a0b956164b44f05.tar.bz2 hercules-7d25827001493a82a8f75cfc6a0b956164b44f05.tar.xz hercules-7d25827001493a82a8f75cfc6a0b956164b44f05.zip |
Dehardcodes db files base path so the db folder can be easily moved
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); |