diff --git a/Changes b/Changes index 408f178b4..8b61109a3 100644 --- a/Changes +++ b/Changes @@ -1338,3 +1338,6 @@ seen. gmtime warning still there - Documented the new allow::options in doc/conf.doc - [nighthawk 2002-06-17] Rewrote m_who.c from scratch. It's slightly different, help.conf explains exactly how. +- [nighthawk 2002-06-17] Changed m_quit.c slightly, removed a redundant strlen, + made prefix-quit of "no" not use one at all, since this + is in example.conf and is sensicle.. diff --git a/src/modules/m_quit.c b/src/modules/m_quit.c index 4668337bf..fecede1c8 100644 --- a/src/modules/m_quit.c +++ b/src/modules/m_quit.c @@ -125,8 +125,11 @@ DLLFUNC int m_quit(aClient *cptr, aClient *sptr, int parc, char *parv[]) if (!IsServer(cptr)) { - ircsprintf(comment, "%s ", - BadPtr(prefix_quit) ? "Quit:" : prefix_quit); + char *s = comment; + + if (strcmp(prefix_quit, "no")) + s = ircsprintf(comment, "%s ", + BadPtr(prefix_quit) ? "Quit:" : prefix_quit); #ifdef CENSOR_QUIT ocomment = (char *)stripbadwords_channel(ocomment); @@ -134,7 +137,7 @@ DLLFUNC int m_quit(aClient *cptr, aClient *sptr, int parc, char *parv[]) if (!IsAnOper(sptr) && ANTI_SPAM_QUIT_MSG_TIME) if (sptr->firsttime+ANTI_SPAM_QUIT_MSG_TIME > TStime()) ocomment = parv[0]; - strncpy(comment + strlen(comment), ocomment, TOPICLEN - 7); + strncpy(s, ocomment, TOPICLEN - (s - comment)); comment[TOPICLEN] = '\0'; return exit_client(cptr, sptr, sptr, comment); }