Explorar el Código

- Fixed ISSPACE and ISALPHA casting their returned value to a char. These are "bool" functions, and as such return an non-zero int as result, casting them to char just... really messes things up when the returned value is out of the CHAR_MAX/CHAR_MIN range!

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9538 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex hace 18 años
padre
commit
edbb476bf9
Se han modificado 2 ficheros con 5 adiciones y 2 borrados
  1. 3 0
      Changelog-Trunk.txt
  2. 2 2
      src/common/cbasetypes.h

+ 3 - 0
Changelog-Trunk.txt

@@ -4,6 +4,9 @@ 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.
 
 2006/12/20
+	* Fixed ISSPACE and ISALPHA casting their returned value to a char, which
+	  can really mess up the scripting engine when the returned value is true,
+	  yet casted to false.
 	* Moved the strip unequip code to before deleting the timer, this fixes
 	  trying to "re-strip" someone causing the skill to fail and on top of that
 	  terminate their current strip effect.

+ 2 - 2
src/common/cbasetypes.h

@@ -289,7 +289,7 @@ typedef char bool;
 //////////////////////////////////////////////////////////////////////////
 // Has to be unsigned to avoid problems in some systems
 #define TOLOWER(c) ((char)tolower((unsigned char)(c)))
-#define ISSPACE(c) ((char)isspace((unsigned char)(c)))
-#define ISALPHA(c) ((char)isalpha((unsigned char)(c)))
+#define ISSPACE(c) (isspace((unsigned char)(c)))
+#define ISALPHA(c) (isalpha((unsigned char)(c)))
 
 #endif /* _CBASETYPES_H_ */