diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/os_shutdown.c | 2 | ||||
-rw-r--r-- | src/core/os_sqline.c | 15 | ||||
-rw-r--r-- | src/operserv.c | 2 |
3 files changed, 8 insertions, 11 deletions
diff --git a/src/core/os_shutdown.c b/src/core/os_shutdown.c index 4dc8728e3..0125297bc 100644 --- a/src/core/os_shutdown.c +++ b/src/core/os_shutdown.c @@ -58,7 +58,7 @@ class OSShutdown : public Module this->SetVersion("$Id$"); this->SetType(CORE); - this->AddCommand(OPERSERV, c, MOD_UNIQUE); + this->AddCommand(OPERSERV, new CommandOSShutdown(), MOD_UNIQUE); this->SetOperHelp(myOperServHelp); } diff --git a/src/core/os_sqline.c b/src/core/os_sqline.c index 5a8f8f1af..6ddd09f57 100644 --- a/src/core/os_sqline.c +++ b/src/core/os_sqline.c @@ -26,7 +26,8 @@ class CommandOSSQLine : public Command private: CommandReturn DoAdd(User *u, std::vector<std::string> ¶ms) { - int deleted = 0, last_param = 2; + int deleted = 0; + unsigned last_param = 2; const char *expiry, *mask; char reason[BUFSIZE]; time_t expires; @@ -61,7 +62,7 @@ class CommandOSSQLine : public Command this->OnSyntaxError(u); return MOD_CONT; } - snprintf(reason, sizeof(reason), "%s%s%s", params[last_param].c_str(), last_param == 2 ? " " : "", last_param == 2 ? param[3].c_str() : ""); + snprintf(reason, sizeof(reason), "%s%s%s", params[last_param].c_str(), last_param == 2 ? " " : "", last_param == 2 ? params[3].c_str() : ""); if (mask && *reason) { /* We first do some sanity check on the proposed mask. */ @@ -94,7 +95,7 @@ class CommandOSSQLine : public Command else { int wall_expiry = expires - time(NULL); - char *s = NULL; + const char *s = NULL; if (wall_expiry >= 86400) { @@ -162,7 +163,7 @@ class CommandOSSQLine : public Command notice_lang(s_OperServ, u, OPER_SQLINE_DELETED_SEVERAL, res); } else { - if ((res = slist_indexof(&sqlines, mask)) == -1) + if ((res = slist_indexof(&sqlines, const_cast<char *>(mask))) == -1) { notice_lang(s_OperServ, u, OPER_SQLINE_NOT_FOUND, mask); return MOD_CONT; @@ -313,15 +314,11 @@ class OSSQLine : public Module public: OSSQLine(const std::string &modname, const std::string &creator) : Module(modname, creator) { - Command *c; - this->SetAuthor("Anope"); this->SetVersion("$Id$"); this->SetType(CORE); - c = createCommand("SQLINE", do_sqline, is_services_oper, - OPER_HELP_SQLINE, -1, -1, -1, -1); - this->AddCommand(OPERSERV, c, MOD_UNIQUE); + this->AddCommand(OPERSERV, new CommandOSSQLine(), MOD_UNIQUE); this->SetOperHelp(myOperServHelp); if (!ircd->sqline) diff --git a/src/operserv.c b/src/operserv.c index b17f895bc..51ddcfaa1 100644 --- a/src/operserv.c +++ b/src/operserv.c @@ -906,7 +906,7 @@ static int is_sgline_entry_equal(SList * slist, void *item1, void *item2) * The success result is the number of SQLINEs that were deleted to successfully add one. */ -int add_sqline(User * u, char *mask, const char *by, const time_t expires, +int add_sqline(User * u, const char *mask, const char *by, time_t expires, const char *reason) { int deleted = 0, i; |