Ensure proper pattern was found and printed
diff --git a/tinyxml2.cpp b/tinyxml2.cpp
index fde1801..7d7026e 100755
--- a/tinyxml2.cpp
+++ b/tinyxml2.cpp
@@ -2102,12 +2102,18 @@
Print( "%.*s", toPrint, p );
p += toPrint;
}
+ bool entityPatternPrinted = false;
for( int i=0; i<NUM_ENTITIES; ++i ) {
if ( entities[i].value == *q ) {
Print( "&%s;", entities[i].pattern );
+ entityPatternPrinted = true;
break;
}
}
+ if ( !entityPatternPrinted ) {
+ // TIXMLASSERT( entityPatternPrinted ) causes gcc -Wunused-but-set-variable in release
+ TIXMLASSERT( false );
+ }
++p;
}
}