From eb3bfb3d7909160b3b34995d074d0bacb7ae77c0 Mon Sep 17 00:00:00 2001 From: Marcus Eggenberger Date: Sat, 8 Aug 2009 12:33:57 +0200 Subject: [PATCH] fixes #764 - client crashes on lines from nicks like "__" Nicks consisting only of underscores are no longer treated as a variant of some basename. --- src/uisupport/uistyle.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/uisupport/uistyle.cpp b/src/uisupport/uistyle.cpp index 18934d6d..d020bb05 100644 --- a/src/uisupport/uistyle.cpp +++ b/src/uisupport/uistyle.cpp @@ -694,7 +694,8 @@ quint8 UiStyle::StyledMessage::senderHash() const { int chopCount = 0; while(nick.at(nick.count() - 1 - chopCount) == '_') chopCount++; - nick.chop(chopCount); + if(chopCount < nick.size()) + nick.chop(chopCount); } quint16 hash = qChecksum(nick.toAscii().data(), nick.toAscii().size()); return (_senderHash = (hash & 0xf) + 1); -- 2.20.1