From 90aa576fb3c1ceae434c2a7b794f13941c80b7b3 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 23 Nov 2013 22:12:33 -0500 Subject: Fix/clean/clarify some stuff found by coverity scan --- modules/commands/cs_clone.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'modules/commands/cs_clone.cpp') diff --git a/modules/commands/cs_clone.cpp b/modules/commands/cs_clone.cpp index 40ef67b53..5a5d52065 100644 --- a/modules/commands/cs_clone.cpp +++ b/modules/commands/cs_clone.cpp @@ -133,16 +133,24 @@ public: } else if (what.equals_ci("BADWORDS")) { - BadWords *target_badwords = target_ci->GetExt("badwords"), + BadWords *target_badwords = target_ci->Require("badwords"), *badwords = ci->Require("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()); } -- cgit