summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-03-23 21:20:36 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-03-23 21:20:36 +0000
commit8727da59032e9536b565b44b462ce7c88f7169d4 (patch)
tree28247340170e2b65963d6d2ac143e4cdd7776a3d
parent1f30a3496f0e4645c16353888b83bc265c3d36bd (diff)
These memsets cant rely on sizeof() any more, afaik. The sizeof() would give 4 or 8, size of the pointer :)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9181 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/users.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/users.cpp b/src/users.cpp
index 59fcf6c94..ee35c3878 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -704,8 +704,8 @@ void User::Oper(const std::string &opertype, const std::string &opername)
if (!AllowedUserModes)
AllowedUserModes = new bool[64];
- memset(AllowedUserModes, 0, 64);
- memset(AllowedChanModes, 0, 64);
+ memset(AllowedUserModes, 0, 63);
+ memset(AllowedChanModes, 0, 63);
char* Classes = strdup(iter_opertype->second);
char* myclass = strtok_r(Classes," ",&savept);
@@ -727,7 +727,7 @@ void User::Oper(const std::string &opertype, const std::string &opername)
{
if (*c == '*')
{
- memset(this->AllowedUserModes, (int)(true), sizeof(this->AllowedUserModes));
+ memset(this->AllowedUserModes, (int)(true), 63);
}
else
{
@@ -738,7 +738,7 @@ void User::Oper(const std::string &opertype, const std::string &opername)
{
if (*c == '*')
{
- memset(this->AllowedChanModes, (int)(true), sizeof(this->AllowedChanModes));
+ memset(this->AllowedChanModes, (int)(true), 63);
}
else
{