Merge pull request #259 from Dmitry-Me/preAndPostAssertsInGetStr

Pointer asserts in GetStr()
This commit is contained in:
Lee Thomason 2015-01-05 17:07:06 -08:00
commit 6e504e9baf
1 changed files with 3 additions and 0 deletions

View File

@ -186,6 +186,8 @@ void StrPair::CollapseWhitespace()
const char* StrPair::GetStr() const char* StrPair::GetStr()
{ {
TIXMLASSERT( _start );
TIXMLASSERT( _end );
if ( _flags & NEEDS_FLUSH ) { if ( _flags & NEEDS_FLUSH ) {
*_end = 0; *_end = 0;
_flags ^= NEEDS_FLUSH; _flags ^= NEEDS_FLUSH;
@ -267,6 +269,7 @@ const char* StrPair::GetStr()
} }
_flags = (_flags & NEEDS_DELETE); _flags = (_flags & NEEDS_DELETE);
} }
TIXMLASSERT( _start );
return _start; return _start;
} }