From d0a472641b7c77fe5f40a6affb62de67be2ee888 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Wed, 11 Dec 2013 05:05:36 +0000 Subject: Fix some logically dead code which was found by Coverity. --- src/users.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index 6b2432cc4..573d4db90 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -1549,7 +1549,7 @@ void User::SplitChanList(User* dest, const std::string &cl) { std::string line; std::ostringstream prefix; - std::string::size_type start, pos, length; + std::string::size_type start, pos; prefix << this->nick << " " << dest->nick << " :"; line = prefix.str(); @@ -1557,23 +1557,13 @@ void User::SplitChanList(User* dest, const std::string &cl) for (start = 0; (pos = cl.find(' ', start)) != std::string::npos; start = pos+1) { - length = (pos == std::string::npos) ? cl.length() : pos; - - if (line.length() + namelen + length - start > 510) + if (line.length() + namelen + pos - start > 510) { ServerInstance->SendWhoisLine(this, dest, 319, "%s", line.c_str()); line = prefix.str(); } - if(pos == std::string::npos) - { - line.append(cl.substr(start, length - start)); - break; - } - else - { - line.append(cl.substr(start, length - start + 1)); - } + line.append(cl.substr(start, pos - start + 1)); } if (line.length() != prefix.str().length()) -- cgit v1.2.3