mirror of https://github.com/AxioDL/tinyxml2.git
Merge pull request #337 from Dmitry-Me/checkEntityFoundExplicitly
Explicitly check entity was not found
This commit is contained in:
commit
949ae37e0a
|
@ -243,8 +243,8 @@ const char* StrPair::GetStr()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int i=0;
|
bool entityFound = false;
|
||||||
for(; i<NUM_ENTITIES; ++i ) {
|
for( int i = 0; i < NUM_ENTITIES; ++i ) {
|
||||||
const Entity& entity = entities[i];
|
const Entity& entity = entities[i];
|
||||||
if ( strncmp( p + 1, entity.pattern, entity.length ) == 0
|
if ( strncmp( p + 1, entity.pattern, entity.length ) == 0
|
||||||
&& *( p + entity.length + 1 ) == ';' ) {
|
&& *( p + entity.length + 1 ) == ';' ) {
|
||||||
|
@ -252,10 +252,11 @@ const char* StrPair::GetStr()
|
||||||
*q = entity.value;
|
*q = entity.value;
|
||||||
++q;
|
++q;
|
||||||
p += entity.length + 2;
|
p += entity.length + 2;
|
||||||
|
entityFound = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( i == NUM_ENTITIES ) {
|
if ( !entityFound ) {
|
||||||
// fixme: treat as error?
|
// fixme: treat as error?
|
||||||
++p;
|
++p;
|
||||||
++q;
|
++q;
|
||||||
|
|
Loading…
Reference in New Issue