summaryrefslogtreecommitdiff
path: root/src/users.cpp
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2013-12-11 05:05:36 +0000
committerAttila Molnar <attilamolnar@hush.com>2014-01-21 00:43:12 +0100
commitd0a472641b7c77fe5f40a6affb62de67be2ee888 (patch)
tree66fd6a7d57d2ca63f4251fb245d3d214d4210d75 /src/users.cpp
parentb8f0e349ce8891d6236fc026c47139af1f05912c (diff)
Fix some logically dead code which was found by Coverity.
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp16
1 files changed, 3 insertions, 13 deletions
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())