From 66d2a8471569d20d746d286b0001ea2633dd14f2 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Sat, 8 Nov 2014 15:24:52 +0300 Subject: [PATCH] Add pre-assert, fix comment --- tinyxml2.cpp | 3 ++- tinyxml2.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 9928444..ef3b469 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -1846,6 +1846,7 @@ void XMLDocument::Print( XMLPrinter* streamer ) const void XMLDocument::SetError( XMLError error, const char* str1, const char* str2 ) { + TIXMLASSERT( error >= 0 && error < XML_ERROR_COUNT ); _errorID = error; _errorStr1 = str1; _errorStr2 = str2; @@ -1853,7 +1854,7 @@ void XMLDocument::SetError( XMLError error, const char* str1, const char* str2 ) const char* XMLDocument::ErrorName() const { - TIXMLASSERT(_errorID >= 0 && _errorID < XML_ERROR_COUNT ); + TIXMLASSERT( _errorID >= 0 && _errorID < XML_ERROR_COUNT ); return _errorNames[_errorID]; } diff --git a/tinyxml2.h b/tinyxml2.h index 2c9c155..5940509 100755 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -491,7 +491,7 @@ public: } }; -// WARNING: must match XMLErrorNames[] +// WARNING: must match XMLDocument::_errorNames[] enum XMLError { XML_SUCCESS = 0, XML_NO_ERROR = 0,