From accccc212cd4f08a3c5532b1ae7a17e76bac8718 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Mon, 6 May 2013 11:49:50 +0100 Subject: Replace some C-isms with C++-isms. * 'const char*' to 'const std::string&'. * snprintf to std::string concatenation. * Replace duplicated OneOfMatches with InspIRCd::MatchMask. --- src/modules/m_chanlog.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/modules/m_chanlog.cpp') diff --git a/src/modules/m_chanlog.cpp b/src/modules/m_chanlog.cpp index 4bfce2108..0f53ceedf 100644 --- a/src/modules/m_chanlog.cpp +++ b/src/modules/m_chanlog.cpp @@ -73,16 +73,15 @@ class ModuleChanLog : public Module if (itpair.first == itpair.second) return MOD_RES_PASSTHRU; - char buf[MAXBUF]; - snprintf(buf, MAXBUF, "\2%s\2: %s", desc.c_str(), msg.c_str()); + const std::string snotice = "\2" + desc + "\2: " + msg; for (ChanLogTargets::const_iterator it = itpair.first; it != itpair.second; ++it) { Channel *c = ServerInstance->FindChan(it->second); if (c) { - c->WriteChannelWithServ(ServerInstance->Config->ServerName, "PRIVMSG %s :%s", c->name.c_str(), buf); - ServerInstance->PI->SendChannelPrivmsg(c, 0, buf); + c->WriteChannelWithServ(ServerInstance->Config->ServerName, "PRIVMSG %s :%s", c->name.c_str(), snotice.c_str()); + ServerInstance->PI->SendChannelPrivmsg(c, 0, snotice); } } -- cgit v1.3.1-10-gc9f91