diff options
-rw-r--r-- | include/extern.h | 2 | ||||
-rw-r--r-- | src/core/os_sgline.c | 16 | ||||
-rw-r--r-- | src/operserv.c | 2 |
3 files changed, 12 insertions, 8 deletions
diff --git a/include/extern.h b/include/extern.h index 0e7d8cf34..77f9d7949 100644 --- a/include/extern.h +++ b/include/extern.h @@ -781,7 +781,7 @@ E int check_akill(const char *nick, const char *username, const char *host, cons E void expire_akills(); E void oper_global(char *nick, const char *fmt, ...); -E int add_sgline(User *u, char *mask, const char *by, const time_t expires, const char *reason); +E int add_sgline(User *u, const char *mask, const char *by, time_t expires, const char *reason); E int check_sgline(const char *nick, const char *realname); E void expire_sglines(); diff --git a/src/core/os_sgline.c b/src/core/os_sgline.c index b79e082c7..baa9f0551 100644 --- a/src/core/os_sgline.c +++ b/src/core/os_sgline.c @@ -14,6 +14,7 @@ /*************************************************************************/ #include "module.h" +#include "hashcomp.h" void myOperServHelp(User *u); int sgline_view_callback(SList *slist, int number, void *item, va_list args); @@ -26,8 +27,9 @@ class CommandOSSGLine : public Command private: CommandReturn OnAdd(User *u, std::vector<std::string> ¶ms) { - int deleted = 0, last_param = 2; - const char *param; + int deleted = 0; + unsigned last_param = 2; + const char *param, *expiry; char rest[BUFSIZE]; time_t expires; @@ -61,7 +63,7 @@ class CommandOSSGLine : public Command this->OnSyntaxError(u); return MOD_CONT; } - snprintf(rest, sizeof(rest), "%s%s%s", param, params.size() > last_param ? " " : "", params.size() > last_param ? param[last_param].c_str() : ""); + snprintf(rest, sizeof(rest), "%s%s%s", param, params.size() > last_param ? " " : "", params.size() > last_param ? params[last_param].c_str() : ""); sepstream sep(rest, ':'); std::string mask; @@ -76,7 +78,7 @@ class CommandOSSGLine : public Command if (mask[masklen - 1] == ' ') mask.erase(masklen - 1); - const char cmask = mask.c_str(); + const char *cmask = mask.c_str(); /* We first do some sanity check on the proposed mask. */ @@ -101,7 +103,7 @@ class CommandOSSGLine : public Command else { int wall_expiry = expires - time(NULL); - char *s = NULL; + const char *s = NULL; if (wall_expiry >= 86400) { @@ -169,7 +171,7 @@ class CommandOSSGLine : public Command notice_lang(s_OperServ, u, OPER_SGLINE_DELETED_SEVERAL, res); } else { - if ((res = slist_indexof(&sglines, mask)) == -1) + if ((res = slist_indexof(&sglines, const_cast<char *>(mask))) == -1) { notice_lang(s_OperServ, u, OPER_SGLINE_NOT_FOUND, mask); return MOD_CONT; @@ -272,6 +274,8 @@ class CommandOSSGLine : public Command { slist_clear(&sglines, 1); notice_lang(s_OperServ, u, OPER_SGLINE_CLEAR); + + return MOD_CONT; } public: CommandOSSGLine() : Command("SGLINE", 1, 3) diff --git a/src/operserv.c b/src/operserv.c index 1b05aa84e..b17f895bc 100644 --- a/src/operserv.c +++ b/src/operserv.c @@ -723,7 +723,7 @@ static int is_akill_entry_equal(SList * slist, void *item1, void *item2) * The success result is the number of SGLINEs that were deleted to successfully add one. */ -int add_sgline(User * u, char *mask, const char *by, const time_t expires, +int add_sgline(User * u, const char *mask, const char *by, time_t expires, const char *reason) { int deleted = 0, i; |