summaryrefslogtreecommitdiff
path: root/src/char/geoip.c
diff options
context:
space:
mode:
authorGuilherme Menaldo <guilherme.menaldo@outlook.com>2019-10-01 22:57:09 -0300
committerGuilherme Menaldo <guilherme.menaldo@outlook.com>2019-10-05 16:42:54 -0300
commit7d25827001493a82a8f75cfc6a0b956164b44f05 (patch)
tree911eff2691b6804c6a971bd86234313ee1af7dcf /src/char/geoip.c
parentd026e28fd78f60dfa21da381f17f2a8cc9ae3d11 (diff)
downloadhercules-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.c5
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);