From 8727da59032e9536b565b44b462ce7c88f7169d4 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 23 Mar 2008 21:20:36 +0000 Subject: 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 --- src/users.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') 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 { -- cgit v1.2.3