Kaynağa Gözat

Should not check errorID with implicit conversion

Dmitry-Me 11 yıl önce
ebeveyn
işleme
9bcd9c7674
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. 2 2
      tinyxml2.cpp

+ 2 - 2
tinyxml2.cpp

@@ -1835,7 +1835,7 @@ XMLError XMLDocument::Parse( const char* p, size_t len )
 
 
     ptrdiff_t delta = p - start;	// skip initial whitespace, BOM, etc.
     ptrdiff_t delta = p - start;	// skip initial whitespace, BOM, etc.
     ParseDeep( _charBuffer+delta, 0 );
     ParseDeep( _charBuffer+delta, 0 );
-    if (_errorID) {
+    if ( Error() ) {
         // clean up now essentially dangling memory.
         // clean up now essentially dangling memory.
         // and the parse fail can put objects in the
         // and the parse fail can put objects in the
         // pools that are dead and inaccessible.
         // pools that are dead and inaccessible.
@@ -1875,7 +1875,7 @@ const char* XMLDocument::ErrorName() const
 
 
 void XMLDocument::PrintError() const
 void XMLDocument::PrintError() const
 {
 {
-    if ( _errorID ) {
+    if ( Error() ) {
         static const int LEN = 20;
         static const int LEN = 20;
         char buf1[LEN] = { 0 };
         char buf1[LEN] = { 0 };
         char buf2[LEN] = { 0 };
         char buf2[LEN] = { 0 };