diff options
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | src/core/cs_access.c | 10 | ||||
-rw-r--r-- | src/core/cs_akick.c | 13 |
3 files changed, 14 insertions, 11 deletions
@@ -46,8 +46,6 @@ Legend: [ ] HelpServ must die (1.9.1?) [-] Command parser cleanup: mod_current_buffer needs to go away and be replaced by a proper parser. Commands should then indicate how they want the buffer split. These all need reviewing, remove them from the list _AS YOU GO_. Talk t0 w00t or CBX if you don't know what this is for: - src/core/cs_access.c - src/core/cs_akick.c src/core/cs_ban.c src/core/cs_clear.c src/core/cs_drop.c diff --git a/src/core/cs_access.c b/src/core/cs_access.c index 3adff98d1..fffa8da38 100644 --- a/src/core/cs_access.c +++ b/src/core/cs_access.c @@ -96,7 +96,7 @@ static int access_list_callback(User * u, int num, va_list args) class CommandCSAccess : public Command { public: - CommandCSAccess() : Command("ACCESS", 0, 4) + CommandCSAccess() : Command("ACCESS", 2, 4) { } @@ -104,8 +104,8 @@ class CommandCSAccess : public Command { const char *chan = params[0].c_str(); const char *cmd = params[1].c_str(); - const char *nick = params[2].c_str(); - const char *s = params[3].c_str(); + const char *nick = params.size() > 2 ? params[2].c_str() : NULL; + const char *s = params.size() > 3 ? params[3].c_str() : NULL; char event_access[BUFSIZE]; ChannelInfo *ci; @@ -394,8 +394,8 @@ class CommandCSLevels : public Command { const char *chan = params[0].c_str(); const char *cmd = params[1].c_str(); - const char *what = params[2].c_str(); - const char *s = params[3].c_str(); + const char *what = params.size() > 2 ? params[2].c_str() : NULL; + const char *s = params.size() > 3 ? params[3].c_str() : NULL; char *error; ChannelInfo *ci; diff --git a/src/core/cs_akick.c b/src/core/cs_akick.c index 9eedef49b..bc21a81a5 100644 --- a/src/core/cs_akick.c +++ b/src/core/cs_akick.c @@ -161,10 +161,15 @@ class CommandCSAKick : public Command { const char *chan = params[0].c_str(); const char *cmd = params[1].c_str(); - const char *mask = params[2].c_str(); - if (params[5].length() > 200) - params[5].resize(200); // XXX: is this right? - const char *reason = params[5].c_str(); + const char *mask = params.size() > 2 ? params[2].c_str() : NULL; + const char *reason = NULL; + + if (params.size() > 3) + { + params[3].resize(200); // XXX: is this right? + reason = params[3].c_str(); + } + ChannelInfo *ci; AutoKick *akick; int i; |