In StringToFunctorType(), return FT_Undefined for an invalid input

This commit is contained in:
eap 2011-08-10 10:27:45 +00:00
parent 339862d49c
commit f1b9e57c55

View File

@ -3811,8 +3811,8 @@ SMESH::FunctorType SMESH::StringToFunctorType(const char* str)
{ {
std::string name( str + 3 ); // skip "FT_" std::string name( str + 3 ); // skip "FT_"
const char** functNames = getFunctNames(); const char** functNames = getFunctNames();
int ft = SMESH::FT_Undefined; int ft = 0;
for ( ; ft >= 0; --ft ) for ( ; ft < SMESH::FT_Undefined; ++ft )
if ( name == ( functNames[ft] + 3 )) if ( name == ( functNames[ft] + 3 ))
break; break;