diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 4efc768..86090d6 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -216,13 +216,14 @@ const char* StrPair::GetStr() // 中 or 中 if ( *(p+1) == '#' ) { - char buf[10] = { 0 }; - int len; + const int buflen = 10; + char buf[buflen] = { 0 }; + int len = 0; p = const_cast( XMLUtil::GetCharacterRef( p, buf, &len ) ); - for( int i=0; i