mirror of
https://github.com/AxioDL/tinyxml2.git
synced 2025-05-14 19:31:23 +00:00
Ensure proper pattern was found and printed
This commit is contained in:
parent
91f2dcfb5c
commit
39c399a0f2
@ -2102,12 +2102,18 @@ void XMLPrinter::PrintString( const char* p, bool restricted )
|
|||||||
Print( "%.*s", toPrint, p );
|
Print( "%.*s", toPrint, p );
|
||||||
p += toPrint;
|
p += toPrint;
|
||||||
}
|
}
|
||||||
|
bool entityPatternPrinted = false;
|
||||||
for( int i=0; i<NUM_ENTITIES; ++i ) {
|
for( int i=0; i<NUM_ENTITIES; ++i ) {
|
||||||
if ( entities[i].value == *q ) {
|
if ( entities[i].value == *q ) {
|
||||||
Print( "&%s;", entities[i].pattern );
|
Print( "&%s;", entities[i].pattern );
|
||||||
|
entityPatternPrinted = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ( !entityPatternPrinted ) {
|
||||||
|
// TIXMLASSERT( entityPatternPrinted ) causes gcc -Wunused-but-set-variable in release
|
||||||
|
TIXMLASSERT( false );
|
||||||
|
}
|
||||||
++p;
|
++p;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user