diff options
author | panikon <panikon@zoho.com> | 2014-05-07 19:41:46 -0300 |
---|---|---|
committer | panikon <panikon@zoho.com> | 2014-05-07 19:41:46 -0300 |
commit | 095c47f5345f63da79495487ca58b7a21800fb6c (patch) | |
tree | cd3cd96f592e26782e9c627c6fb4d20a78077c35 /src/char/inter.c | |
parent | acf4079c828a56c5ba761698b425168110d3722f (diff) | |
download | hercules-095c47f5345f63da79495487ca58b7a21800fb6c.tar.gz hercules-095c47f5345f63da79495487ca58b7a21800fb6c.tar.bz2 hercules-095c47f5345f63da79495487ca58b7a21800fb6c.tar.xz hercules-095c47f5345f63da79495487ca58b7a21800fb6c.zip |
Follow up to 9a425c1
Special thanks to @MishimaHaruna
Diffstat (limited to 'src/char/inter.c')
-rw-r--r-- | src/char/inter.c | 12 |
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); } } |