summaryrefslogtreecommitdiff
path: root/src/char/geoip.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-01-24 03:42:16 +0100
committerHaru <haru@dotalux.com>2015-01-24 03:42:36 +0100
commita75714ca455c728d34918dd12200fcec87ebc0d4 (patch)
treed95d174b239a14fafdb8e824bad4a9c81a5a5a80 /src/char/geoip.c
parentdf8d6560fc7eb34806d27d28b8b7dbce36868c24 (diff)
downloadhercules-a75714ca455c728d34918dd12200fcec87ebc0d4.tar.gz
hercules-a75714ca455c728d34918dd12200fcec87ebc0d4.tar.bz2
hercules-a75714ca455c728d34918dd12200fcec87ebc0d4.tar.xz
hercules-a75714ca455c728d34918dd12200fcec87ebc0d4.zip
Fixed 18 minor issues
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/char/geoip.c')
-rw-r--r--src/char/geoip.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/char/geoip.c b/src/char/geoip.c
index 1268019e1..889958e16 100644
--- a/src/char/geoip.c
+++ b/src/char/geoip.c
@@ -136,7 +136,7 @@ void geoip_init(void)
geoip->final(false);
return;
}
- geoip->data->cache = aMalloc( (sizeof(geoip->data->cache) * bufa.st_size) );
+ geoip->data->cache = aMalloc(sizeof(unsigned char) * bufa.st_size);
if (fread(geoip->data->cache, sizeof(unsigned char), bufa.st_size, db) != bufa.st_size) {
ShowError("geoip_cache: Couldn't read all elements!\n");
fclose(db);
@@ -157,7 +157,10 @@ void geoip_init(void)
}
break;
} else {
- fseek(db, -4l, SEEK_CUR);
+ if (fseek(db, -4l, SEEK_CUR) != 0) {
+ db_type = 0;
+ break;
+ }
}
}