Ensure proper pattern was found and printed

This commit is contained in:
Dmitry-Me 2015-05-28 15:32:27 +03:00
parent 91f2dcfb5c
commit 39c399a0f2
1 changed files with 6 additions and 0 deletions

View File

@ -2102,12 +2102,18 @@ void XMLPrinter::PrintString( const char* p, bool restricted )
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;
}
}