summaryrefslogtreecommitdiff
path: root/include/services.h
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-08-28 20:56:45 -0400
committerAdam <Adam@anope.org>2010-08-28 20:56:45 -0400
commite820e1af0d01011dbe9d91d2971cc3518f7f3d42 (patch)
tree9eb52cf891c4cd92ad08ad8d2f7c019780bc6223 /include/services.h
parent26ba944d55fb4ee92dd5d7a3d2cfa869a8be151f (diff)
Properly store our clients internal channel status's and burst them if needed.
Also made Flag::HasFlag use test() instead of operator[] to catch errors, and fixed an out of bounds access to a Flags bitset causing crashes on some systems.
Diffstat (limited to 'include/services.h')
-rw-r--r--include/services.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/services.h b/include/services.h
index f8f37be6e..4702dcff1 100644
--- a/include/services.h
+++ b/include/services.h
@@ -301,7 +301,7 @@ template<typename T, typename O> inline T debug_cast(O ptr)
{
#ifdef DEBUG_BUILD
T ret = dynamic_cast<T>(ptr);
- if (ret == NULL)
+ if (ptr != NULL && ret == NULL)
throw CoreException(Anope::string("debug_cast<") + typeid(T).name() + ">(" + typeid(O).name() + ") fail");
return ret;
#else
@@ -342,7 +342,7 @@ template<typename T, size_t Size = 32> class Flags
*/
bool HasFlag(T Value) const
{
- return Flag_Values[Value];
+ return Flag_Values.test(Value);
}
/** Check how many flags are set