From 0757a4a495daabf661ac3b7ab79f0a5ee423abe8 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 16 Jul 2006 12:18:29 +0000 Subject: 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 --- src/cmd_quit.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/cmd_quit.cpp') 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 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. -- cgit v1.3.1-10-gc9f91