From 506125af144a1417f4144ce6d8d85b7b6181992b Mon Sep 17 00:00:00 2001 From: Mathieu Rondonneau Date: Sat, 18 Jun 2011 15:55:11 -0700 Subject: [PATCH] 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. --- .../openpilotgcs/src/plugins/gcscontrol/gcscontrolgadget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/gcscontrol/gcscontrolgadget.cpp b/ground/openpilotgcs/src/plugins/gcscontrol/gcscontrolgadget.cpp index 9480d789e..3c00987f7 100644 --- a/ground/openpilotgcs/src/plugins/gcscontrol/gcscontrolgadget.cpp +++ b/ground/openpilotgcs/src/plugins/gcscontrol/gcscontrolgadget.cpp @@ -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; }