From c2aea2aa5a3266d9eec054d83f8fb93afcf6cb99 Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Thu, 24 Sep 2015 18:34:43 +0200 Subject: Flip "mess.length() > QString(CMD_SIGN).length() && mess.left(QString(CMD_SIGN).length()) == CMD_SIGN" to avoid a crash when CMD_SIGN is longer than the message --- src/crsm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/crsm.cpp') diff --git a/src/crsm.cpp b/src/crsm.cpp index e53b201..9275066 100644 --- a/src/crsm.cpp +++ b/src/crsm.cpp @@ -451,7 +451,7 @@ void CRSM::ircMessageReceived(IrcMessage *message) { writeToServer("[IRC]<" + message->nick() + "> " + mess + "\n"); } - else if(mess.left(QString(CMD_SIGN).length()) == CMD_SIGN && mess.length() > QString(CMD_SIGN).length()) + else if(mess.length() > QString(CMD_SIGN).length() && mess.left(QString(CMD_SIGN).length()) == CMD_SIGN) { QStringList args = mess.right(mess.length() - QString(CMD_SIGN).length()).split(" ", QString::SkipEmptyParts); QString command = args.first().trimmed(); -- cgit v1.2.3-54-g00ecf