pvatools: enum index out of range fix

This commit is contained in:
Matej Sekoranja
2014-11-24 12:12:22 +01:00
parent e8b3783e01
commit b29c8f439b

View File

@ -130,7 +130,7 @@ std::ostream& printEnumT(std::ostream& o, epics::pvData::PVStructure const & pvE
if (enumMode == AutoEnum || enumMode == StringEnum)
{
int32 ix = pvIndex->get();
if (ix < 0 || ix > static_cast<int32>(pvChoices->getLength()))
if (ix < 0 || ix >= static_cast<int32>(pvChoices->getLength()))
o << ix;
else
pvChoices->dumpValue(o, ix);