summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/commands.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/commands.cpp b/src/commands.cpp
index bcdf4971d..427633ef4 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -85,7 +85,7 @@ void split_chlist(userrec* user, userrec* dest, const std::string &cl)
prefix << ":" << Config->ServerName << " 319 " << user->nick << " " << dest->nick << " :";
line = prefix.str();
- for (start = 0; pos = cl.find(' ', start); start = pos+1)
+ for (start = 0; (pos = cl.find(' ', start)) != std::string::npos; start = pos+1)
{
length = (pos == std::string::npos) ? cl.length() : pos;