diff --git a/tinyxml2.cpp b/tinyxml2.cpp index f6e2584..e70c77d 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -1861,7 +1861,6 @@ XMLError XMLDocument::SaveFile( FILE* fp, bool compact ) XMLError XMLDocument::Parse( const char* p, size_t len ) { - const char* start = p; Clear(); if ( len == 0 || !p || !*p ) { @@ -1875,6 +1874,7 @@ XMLError XMLDocument::Parse( const char* p, size_t len ) memcpy( _charBuffer, p, len ); _charBuffer[len] = 0; + const char* start = p; p = XMLUtil::SkipWhiteSpace( p ); p = XMLUtil::ReadBOM( p, &_writeBOM ); if ( !p || !*p ) { diff --git a/tinyxml2.h b/tinyxml2.h index 35da4d9..b88e2d0 100755 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -562,10 +562,10 @@ public: } inline static bool StringEqual( const char* p, const char* q, int nChar=INT_MAX ) { - int n = 0; if ( p == q ) { return true; } + int n = 0; while( *p && *q && *p == *q && n