more bounds checks

This commit is contained in:
john30
2015-03-11 08:42:28 +01:00
parent 4573cf53ae
commit 0d44c9bacd
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -305,7 +305,7 @@ public:
PartType getPartType() const { return m_partType; }
// @copydoc
virtual unsigned char getLength(PartType partType) { return partType == m_partType ? m_length : 0; };
virtual unsigned char getLength(PartType partType) { return partType == m_partType ? m_length : (unsigned char)0; };
// re-use same position as previous field as not all bits of fully consumed yet
/**
@@ -557,7 +557,7 @@ public:
const unsigned char length, const unsigned char bitCount,
const map<unsigned int, string> values)
: NumericDataField(name, comment, unit, dataType, partType, length, bitCount,
(dataType.bitCount < 8) ? (unsigned char)dataType.divisorOrFirstBit : 0),
(unsigned char)((dataType.bitCount < 8) ? dataType.divisorOrFirstBit : 0)),
m_values(values) {}
/**