diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-01-21 18:44:08 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-01-21 18:44:08 +0100 |
commit | e244cb2c63b1ac1d85bdbb4691f7b1bd940ae804 (patch) | |
tree | 5a69b0efe6c0b7ab88925d3d066271ec40845e23 /src/commands/cmd_whois.cpp | |
parent | fead8af2b767cb5591536a3c98babf6b35194a66 (diff) | |
parent | 7dd831383f7506e49f568d0684ee1ecb1f5dc90f (diff) |
Merge insp20
Diffstat (limited to 'src/commands/cmd_whois.cpp')
-rw-r--r-- | src/commands/cmd_whois.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/commands/cmd_whois.cpp b/src/commands/cmd_whois.cpp index 7e67676ed..e8a751fa0 100644 --- a/src/commands/cmd_whois.cpp +++ b/src/commands/cmd_whois.cpp @@ -80,7 +80,7 @@ void CommandWhois::SplitChanList(User* source, 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 << dest->nick << " :"; line = prefix.str(); @@ -88,23 +88,13 @@ void CommandWhois::SplitChanList(User* source, 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(source, dest, 319, line); 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()) |