mirror of https://github.com/AxioDL/tinyxml2.git
Merge pull request #326 from Dmitry-Me/cleanupPointersComparison
Unify pointers comparison, consistency asserts
This commit is contained in:
commit
882e89e601
|
@ -2064,6 +2064,7 @@ void XMLPrinter::PrintString( const char* p, bool restricted )
|
||||||
if ( _processEntities ) {
|
if ( _processEntities ) {
|
||||||
const bool* flag = restricted ? _restrictedEntityFlag : _entityFlag;
|
const bool* flag = restricted ? _restrictedEntityFlag : _entityFlag;
|
||||||
while ( *q ) {
|
while ( *q ) {
|
||||||
|
TIXMLASSERT( p <= q );
|
||||||
// Remember, char is sometimes signed. (How many times has that bitten me?)
|
// Remember, char is sometimes signed. (How many times has that bitten me?)
|
||||||
if ( *q > 0 && *q < ENTITY_RANGE ) {
|
if ( *q > 0 && *q < ENTITY_RANGE ) {
|
||||||
// Check for entities. If one is found, flush
|
// Check for entities. If one is found, flush
|
||||||
|
@ -2087,11 +2088,13 @@ void XMLPrinter::PrintString( const char* p, bool restricted )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
++q;
|
++q;
|
||||||
|
TIXMLASSERT( p <= q );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Flush the remaining string. This will be the entire
|
// Flush the remaining string. This will be the entire
|
||||||
// string if an entity wasn't found.
|
// string if an entity wasn't found.
|
||||||
if ( !_processEntities || (q-p > 0) ) {
|
TIXMLASSERT( p <= q );
|
||||||
|
if ( !_processEntities || ( p < q ) ) {
|
||||||
Print( "%s", p );
|
Print( "%s", p );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue