X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fm_quit.c;h=9ca6786325ede6f5147beaccb3f1317579cd80c4;hb=cc05a230ac079fa15a2e43e6e68ef7126128cefd;hp=38d47e29d5c74ae74bc63cb65557b3cc9a7a20d1;hpb=b8294f6c0db86ec8d204b0fda51070f3a415fb57;p=ircu2.10.12-pk.git diff --git a/ircd/m_quit.c b/ircd/m_quit.c index 38d47e2..9ca6786 100644 --- a/ircd/m_quit.c +++ b/ircd/m_quit.c @@ -83,6 +83,7 @@ #include "channel.h" #include "client.h" +#include "ircd.h" #include "ircd_string.h" #include "struct.h" #include "s_misc.h" @@ -99,7 +100,6 @@ */ int m_quit(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { - char comment[TOPICLEN]; assert(0 != cptr); assert(0 != sptr); assert(cptr == sptr); @@ -111,16 +111,10 @@ int m_quit(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) return exit_client(cptr, sptr, sptr, "Signed off"); } } - - if (parc > 1) { - strcpy(comment,"Quit: "); - strncat(comment,parv[parc-1],sizeof(comment)-strlen("Quit: ")); - comment[sizeof(comment)] = '\0'; - } - else { - strncpy(comment,cli_name(cptr),sizeof(comment)); - } - return exit_client(cptr, sptr, sptr, comment); + if (parc > 1 && !BadPtr(parv[parc - 1])) + return exit_client_msg(cptr, sptr, sptr, "Quit: %s", parv[parc - 1]); + else + return exit_client(cptr, sptr, sptr, "Quit"); }