From c8bafafedc10271fdf465363f611c995fabc1d9e Mon Sep 17 00:00:00 2001 From: firewave Date: Thu, 26 Oct 2023 11:26:04 +0200 Subject: [PATCH] fixed `knownConditionTrueFalse` Cppcheck warning `*(p+2)` is already checked in the preceding if-condition, so it is redundant --- tinyxml2.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 4b561b3d..dc43e43f 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -531,12 +531,7 @@ const char* XMLUtil::GetCharacterRef( const char* p, char* value, int* length ) } else { // Decimal. - const char* q = p+2; - if ( !(*q) ) { - return 0; - } - - q = strchr( q, SEMICOLON ); + const char* q = strchr( p+2, SEMICOLON ); if ( !q ) { return 0;