diff options
author | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-10 21:16:00 +0000 |
---|---|---|
committer | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-10 21:16:00 +0000 |
commit | b1ee732713a2e0b4dd96d1c14b1ccfe21160df83 (patch) | |
tree | 6c3fe44eccd53982a275dce76d03c3c413a64093 | |
parent | ef9f97fa05c195b4c49b272bcbfc608247421fb2 (diff) |
Few fixes.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1987 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | include/extern.h | 6 | ||||
-rw-r--r-- | src/core/os_admin.c | 7 | ||||
-rw-r--r-- | src/core/os_akill.c | 9 | ||||
-rw-r--r-- | src/operserv.c | 2 |
4 files changed, 15 insertions, 9 deletions
diff --git a/include/extern.h b/include/extern.h index 4d5a358d1..5a11e9e95 100644 --- a/include/extern.h +++ b/include/extern.h @@ -772,7 +772,7 @@ E int nick_is_services_root(NickCore * nc); E int nick_is_services_admin(NickCore *nc); E int nick_is_services_oper(NickCore *nc); -E int add_akill(User *u, char *mask, const char *by, const time_t expires, const char *reason); +E int add_akill(User *u, const char *mask, const char *by, const time_t expires, const char *reason); E int check_akill(const char *nick, const char *username, const char *host, const char *vhost, const char *ip); E void expire_akills(); E void oper_global(char *nick, const char *fmt, ...); @@ -888,8 +888,8 @@ E int exception_add(User * u, const char *mask, const int limit, E int slist_add(SList *slist, void *item); E void slist_clear(SList *slist, int free); E int slist_delete(SList *slist, int index); -E int slist_delete_range(SList *slist, char *range, slist_delcheckcb_t cb, ...); -E int slist_enum(SList *slist, char *range, slist_enumcb_t cb, ...); +E int slist_delete_range(SList *slist, const char *range, slist_delcheckcb_t cb, ...); +E int slist_enum(SList *slist, const char *range, slist_enumcb_t cb, ...); E int slist_full(SList *slist); E int slist_indexof(SList *slist, void *item); E void slist_init(SList *slist); diff --git a/src/core/os_admin.c b/src/core/os_admin.c index fcf3e05f7..ad7f6130b 100644 --- a/src/core/os_admin.c +++ b/src/core/os_admin.c @@ -24,6 +24,7 @@ class CommandOSAdmin : public Command private: CommandReturn DoAdd(User *u, std::vector<std::string> ¶ms) { + NickAlias *na; const char *nick = params.size() > 1 ? params[1].c_str() : NULL; int res = 0; @@ -87,6 +88,7 @@ class CommandOSAdmin : public Command CommandReturn DoDel(User *u, std::vector<std::string> ¶ms) { const char *nick = params.size() > 1 ? params[1].c_str() : NULL; + NickAlias *na; int res = 0; if (!nick) @@ -232,6 +234,11 @@ class CommandOSAdmin : public Command this->OnSyntaxError(u); return MOD_CONT; } + + void OnSyntaxError(User *u) + { + syntax_error(s_OperServ, u, "ADMIN", OPER_ADMIN_SYNTAX); + } }; class OSAdmin : public Module diff --git a/src/core/os_akill.c b/src/core/os_akill.c index 93178d4bc..d2ff92b7e 100644 --- a/src/core/os_akill.c +++ b/src/core/os_akill.c @@ -61,7 +61,7 @@ class CommandOSAKill : 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. */ if (strchr(mask, '!')) @@ -106,7 +106,7 @@ class CommandOSAKill : public Command else { int wall_expiry = expires - time(NULL); - char *s = NULL; + const char *s = NULL; if (wall_expiry >= 86400) { @@ -144,7 +144,7 @@ class CommandOSAKill : public Command const char *mask; int res = 0; - mask = params.size() > 1 ? params[1].c_str(); + mask = params.size() > 1 ? params[1].c_str() : NULL; if (!mask) { @@ -174,7 +174,7 @@ class CommandOSAKill : public Command } else { - if ((res = slist_indexof(&akills, mask)) == -1) + if ((res = slist_indexof(&akills, (void *)mask)) == -1) { notice_lang(s_OperServ, u, OPER_AKILL_NOT_FOUND, mask); return MOD_CONT; @@ -291,7 +291,6 @@ class CommandOSAKill : public Command CommandReturn Execute(User *u, std::vector<std::string> ¶ms) { const char *cmd = params[0].c_str(); - char breason[BUFSIZE]; if (!stricmp(cmd, "ADD")) return this->DoAdd(u, params); diff --git a/src/operserv.c b/src/operserv.c index 1d8f2a5f6..1b05aa84e 100644 --- a/src/operserv.c +++ b/src/operserv.c @@ -490,7 +490,7 @@ void oper_global(char *nick, const char *fmt, ...) * The success result is the number of AKILLs that were deleted to successfully add one. */ -int add_akill(User * u, char *mask, const char *by, const time_t expires, +int add_akill(User * u, const char *mask, const char *by, const time_t expires, const char *reason) { int deleted = 0, i; |