summaryrefslogtreecommitdiff
path: root/src/char/inter.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/char/inter.c')
-rw-r--r--src/char/inter.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/char/inter.c b/src/char/inter.c
index a2ff556d9..6cb349fd3 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -453,8 +453,10 @@ const char* geoip_getcountry(uint32 ipnum){
* frees geoip.cache
**/
void geoip_final( void ) {
- if( geoip.cache )
+ if( geoip.cache ) {
aFree(geoip.cache);
+ geoip.cache = NULL;
+ }
if( geoip.active ) {
ShowStatus("GeoIP "CL_RED"disabled"CL_RESET".\n");
@@ -497,14 +499,14 @@ void geoip_init(void) {
}
// Search database type
- lseek(fno, -3l, SEEK_END);
+ fseek(db, -3l, SEEK_END);
for( i = 0; i < GEOIP_STRUCTURE_INFO_MAX_SIZE; i++ ) {
- read(fno, delim, 3);
+ fread(delim, sizeof(delim[0]), 3, db);
if( delim[0] == 255 && delim[1] == 255 && delim[2] == 255 ) {
- read(fno, &db_type, 1);
+ fread(&db_type, sizeof(db_type), 1, db);
break;
} else {
- lseek(fno, -4l, SEEK_CUR);
+ fseek(db, -4l, SEEK_CUR);
}
}