1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

OP-423: fix problem in GCS when the config files get deleted.

GCS aborts on a table overflow when trying to set the axes with wrong number of channels.
This commit is contained in:
Mathieu Rondonneau 2011-06-18 15:55:11 -07:00
parent 21f988321e
commit d5cd3e0d2a

View File

@ -283,8 +283,8 @@ void GCSControlGadget::buttonState(ButtonNumber number, bool pressed)
void GCSControlGadget::axesValues(QListInt16 values)
{
int chMax = values.length();
if (rollChannel > chMax || pitchChannel > chMax ||
yawChannel > chMax || throttleChannel > chMax ) {
if (rollChannel >= chMax || pitchChannel >= chMax ||
yawChannel >= chMax || throttleChannel >= chMax ) {
qDebug() << "GCSControl: configuration is inconsistent with current joystick! Aborting update.";
return;
}