Merge pull request #458 from CSS-Electronics/feature_support_fd_in_comparison
Avoid undefined behavior if FD frame datalengths are present in sorting
This commit is contained in:
+1
-1
@@ -253,7 +253,7 @@ uint64_t CANFrameModel::getCANFrameVal(int row, Column col)
|
||||
return static_cast<uint64_t>(frame.payload().length());
|
||||
case Column::ASCII: //sort both the same for now
|
||||
case Column::Data:
|
||||
for (int i = 0; i < frame.payload().length(); i++) temp += (static_cast<uint64_t>(frame.payload()[i]) << (56 - (8 * i)));
|
||||
for (int i = 0; i < std::min(frame.payload().length(), 8); i++) temp += (static_cast<uint64_t>(frame.payload()[i]) << (56 - (8 * i)));
|
||||
//qDebug() << temp;
|
||||
return temp;
|
||||
case Column::NUM_COLUMN:
|
||||
|
||||
Reference in New Issue
Block a user