fixes #764 - client crashes on lines from nicks like "__"
authorMarcus Eggenberger <egs@quassel-irc.org>
Sat, 8 Aug 2009 10:33:57 +0000 (12:33 +0200)
committerMarcus Eggenberger <egs@quassel-irc.org>
Sat, 8 Aug 2009 10:33:57 +0000 (12:33 +0200)
Nicks consisting only of underscores are no longer treated as a variant of some basename.

src/uisupport/uistyle.cpp

index 18934d6..d020bb0 100644 (file)
@@ -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);