Browse Source

Fixed login_sql ipbans not working (due to signed/unsigned mismatch)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10390 54d463be-8e91-2dee-dedb-b68131a5f0ec
ultramage 18 years ago
parent
commit
ebf0f16a7e
2 changed files with 2 additions and 1 deletions
  1. 1 0
      Changelog-Trunk.txt
  2. 1 1
      src/login_sql/login.c

+ 1 - 0
Changelog-Trunk.txt

@@ -4,6 +4,7 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 2007/04/29
+	* Fixed login_sql ipbans not working
 	* login server will now bind only after finishing the init phase
 	* Tried and fixed md5 password encryption [ultramage]
 	- login_sql was doing stupid things like re-using one pre-generated

+ 1 - 1
src/login_sql/login.c

@@ -1260,7 +1260,7 @@ int lan_subnetcheck(uint32 ip)
 
 int login_ip_ban_check(uint32 ip)
 {
-	char* p = (char*)&ip;
+	uint8* p = (uint8*)&ip;
 	sprintf(tmpsql, "SELECT count(*) FROM `ipbanlist` WHERE `list` = '%d.*.*.*' OR `list` = '%d.%d.*.*' OR `list` = '%d.%d.%d.*' OR `list` = '%d.%d.%d.%d'",
 		p[3], p[3], p[2], p[3], p[2], p[1], p[3], p[2], p[1], p[0]);
 	if (mysql_query(&mysql_handle, tmpsql)) {