summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2007-09-12 11:07:50 +0000
committerspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2007-09-12 11:07:50 +0000
commit4b15d480b5fb31aa105f0becccf0dd184d47911d (patch)
treea09869e740413908c9e6011a038b5e91a1b98d26
parent68dc3792ee7b91fbc9cd662bd966d5c9cb63824a (diff)
Modified m_cloaking to not use need_positive (instead, cast to an unsigned int). This allows it to use all possible values for an unsigned int, instead of just the positive values in a signed int
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8026 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/m_cloaking.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp
index 8e80ad89a..d10f02ce4 100644
--- a/src/modules/m_cloaking.cpp
+++ b/src/modules/m_cloaking.cpp
@@ -254,12 +254,17 @@ class CloakUser : public ModeHandler
{
ConfigReader Conf(ServerInstance);
bool lowercase;
-
+
+ /* These are *not* using the need_positive parameter of ReadInteger -
+ * that will limit the valid values to only the positive values in a
+ * signed int. Instead, accept any value that fits into an int and
+ * cast it to an unsigned int. That will, a bit oddly, give us the full
+ * spectrum of an unsigned integer. - Special */
key1 = key2 = key3 = key4 = 0;
- key1 = Conf.ReadInteger("cloak","key1",0,true);
- key2 = Conf.ReadInteger("cloak","key2",0,true);
- key3 = Conf.ReadInteger("cloak","key3",0,true);
- key4 = Conf.ReadInteger("cloak","key4",0,true);
+ key1 = (unsigned int) Conf.ReadInteger("cloak","key1",0,false);
+ key2 = (unsigned int) Conf.ReadInteger("cloak","key2",0,false);
+ key3 = (unsigned int) Conf.ReadInteger("cloak","key3",0,false);
+ key4 = (unsigned int) Conf.ReadInteger("cloak","key4",0,false);
prefix = Conf.ReadValue("cloak","prefix",0);
ipalways = Conf.ReadFlag("cloak", "ipalways", 0);
lowercase = Conf.ReadFlag("cloak", "lowercase", 0);