aboutsummaryrefslogtreecommitdiff
path: root/src/cmd_quit.cpp
diff options
context:
space:
mode:
authorGravatar brain2006-07-16 12:18:29 +0000
committerGravatar brain2006-07-16 12:18:29 +0000
commit0757a4a495daabf661ac3b7ab79f0a5ee423abe8 (patch)
treed788af6cee694ae3b623bbfbbc31864de43b9d12 /src/cmd_quit.cpp
parentMAJOR tidy of line parser, some parts rewritten and major chunks removed (diff)
mass tidyup, change A LOT of stuff to const char** which was char** (such as parameters to commands in handlers)
which makes the new lineparser work neater with no casts. This also removes tons of casts from other locations (all in all, ive added 2 casts and removed almost a hundred) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4403 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/cmd_quit.cpp')
-rw-r--r--src/cmd_quit.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/cmd_quit.cpp b/src/cmd_quit.cpp
index 7c0b602e9..5011d230e 100644
--- a/src/cmd_quit.cpp
+++ b/src/cmd_quit.cpp
@@ -47,10 +47,10 @@ extern chan_hash chanlist;
extern std::vector<userrec*> local_users;
extern userrec* fd_ref_table[MAX_DESCRIPTORS];
-void cmd_quit::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_quit::Handle (const char** parameters, int pcnt, userrec *user)
{
user_hash::iterator iter = clientlist.find(user->nick);
- char* reason;
+ char reason[MAXBUF];
if (user->registered == 7)
{
@@ -60,10 +60,7 @@ void cmd_quit::Handle (char **parameters, int pcnt, userrec *user)
if (*parameters[0] == ':')
parameters[0]++;
- reason = parameters[0];
-
- if (strlen(reason) > MAXQUIT)
- reason[MAXQUIT-1] = 0;
+ strlcpy(reason, parameters[0],MAXQUIT-1);
/* We should only prefix the quit for a local user. Remote users have
* already been prefixed, where neccessary, by the upstream server.