diff options
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r-- | src/gui/chat.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index ef625753..a0f12b2c 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -363,6 +363,13 @@ void ChatWindow::chatSend(const std::string &nick, std::string msg) std::string::size_type end = msg.find(']', start); if (end != std::string::npos) { + // Catch multiple embeds and ignore them so it doesn't crash the client. + while ((msg.find('[', start + 1) != std::string::npos) && + (msg.find('[', start + 1) < end)) + { + start = msg.find('[', start + 1); + } + std::string temp = msg.substr(start+1, end - start - 1); while (temp[0] == ' ') |