mirror of https://github.com/AxioDL/tinyxml2.git
Pre-asserts to clarify buffer usage
This commit is contained in:
parent
38b49ae042
commit
30bdc9735b
|
@ -1997,6 +1997,7 @@ void XMLPrinter::Print( const char* format, ... )
|
||||||
// Close out and re-start the va-args
|
// Close out and re-start the va-args
|
||||||
va_end( va );
|
va_end( va );
|
||||||
va_start( va, format );
|
va_start( va, format );
|
||||||
|
TIXMLASSERT( _buffer.Size() > 0 && _buffer[_buffer.Size() - 1] == 0 );
|
||||||
char* p = _buffer.PushArr( len ) - 1; // back up over the null terminator.
|
char* p = _buffer.PushArr( len ) - 1; // back up over the null terminator.
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1400 )
|
#if defined(_MSC_VER) && (_MSC_VER >= 1400 )
|
||||||
#if defined(WINCE)
|
#if defined(WINCE)
|
||||||
|
|
|
@ -276,6 +276,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
int Size() const {
|
int Size() const {
|
||||||
|
TIXMLASSERT( _size >= 0 );
|
||||||
return _size;
|
return _size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue