From eb09c87d99ff3a8128ba085404bcbd2d989ad584 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Fri, 21 Dec 2012 12:30:04 +0100 Subject: [PATCH] C++: fix PPToken equals operator for c-strings. Change-Id: I37411faa1724fb69467036279b2821e33cad26b5 Reviewed-by: Nikolai Kosjar --- src/libs/cplusplus/PPToken.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/cplusplus/PPToken.h b/src/libs/cplusplus/PPToken.h index 9ae8a8de4e7..a0719b14e30 100644 --- a/src/libs/cplusplus/PPToken.h +++ b/src/libs/cplusplus/PPToken.h @@ -89,7 +89,7 @@ public: { return !this->operator==(other); } bool operator==(const char *other) const - { return qstrncmp(m_start, other, qstrlen(other)) == 0; } + { return m_length == (int) qstrlen(other) && !qstrncmp(m_start, other, m_length); } bool operator!=(const char *other) const { return !this->operator==(other); }