1
0
mirror of https://github.com/anope/anope.git synced 2026-07-09 23:43:12 +02:00

Fix/clean/clarify some stuff found by coverity scan

This commit is contained in:
Adam
2013-11-23 22:12:33 -05:00
parent 77e5744341
commit 90aa576fb3
6 changed files with 18 additions and 11 deletions
+11 -3
View File
@@ -133,16 +133,24 @@ public:
}
else if (what.equals_ci("BADWORDS"))
{
BadWords *target_badwords = target_ci->GetExt<BadWords>("badwords"),
BadWords *target_badwords = target_ci->Require<BadWords>("badwords"),
*badwords = ci->Require<BadWords>("badwords");
if (target_badwords)
if (target_badwords && badwords)
{
target_badwords->ClearBadWords();
if (badwords)
for (unsigned i = 0; i < badwords->GetBadWordCount(); ++i)
{
const BadWord *bw = badwords->GetBadWord(i);
target_badwords->AddBadWord(bw->word, bw->type);
}
}
if (badwords)
badwords->Check();
if (target_badwords)
target_badwords->Check();
source.Reply(_("All badword entries from \002%s\002 have been cloned to \002%s\002."), channel.c_str(), target.c_str());
}