summaryrefslogtreecommitdiff
path: root/src/char
diff options
context:
space:
mode:
Diffstat (limited to 'src/char')
-rw-r--r--src/char/geoip.c7
-rw-r--r--src/char/int_auction.c2
-rw-r--r--src/char/inter.c2
3 files changed, 8 insertions, 3 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;
+ }
}
}
diff --git a/src/char/int_auction.c b/src/char/int_auction.c
index 164ca5360..57eae641d 100644
--- a/src/char/int_auction.c
+++ b/src/char/int_auction.c
@@ -105,7 +105,7 @@ unsigned int inter_auction_create(struct auction_data *auction)
else
{
struct auction_data *auction_;
- int64 tick = auction->hours * 3600000;
+ int64 tick = (int64)auction->hours * 3600000;
auction->item.amount = 1;
auction->item.identify = 1;
diff --git a/src/char/inter.c b/src/char/inter.c
index 5af9a6aab..eb14f1593 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -690,9 +690,11 @@ int inter_accreg_fromsql(int account_id,int char_id, int fd, int type)
if( SQL_ERROR == SQL->Query(inter->sql_handle, "SELECT `key`, `index`, `value` FROM `%s` WHERE `account_id`='%d'", acc_reg_num_db, account_id) )
Sql_ShowDebug(inter->sql_handle);
break;
+#if 0 // This is already checked above.
case 1: //account2 reg
ShowError("inter->accreg_fromsql: Char server shouldn't handle type 1 registry values (##). That is the login server's work!\n");
return 0;
+#endif // 0
}
WFIFOHEAD(fd, 60000 + 300);