1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-30 08:24:11 +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 b67a38661e
commit 506125af14

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;
}