Browse Source

Fix parameter range check

sbg
Jean Cyr 12 years ago
parent
commit
f246b68c7b
  1. 2
      src/drivers/stm32/tone_alarm/tone_alarm.cpp

2
src/drivers/stm32/tone_alarm/tone_alarm.cpp

@ -874,7 +874,7 @@ ToneAlarm::ioctl(file *filp, int cmd, unsigned long arg) @@ -874,7 +874,7 @@ ToneAlarm::ioctl(file *filp, int cmd, unsigned long arg)
case TONE_SET_ALARM:
debug("TONE_SET_ALARM %u", arg);
if (arg <= TONE_NUMBER_OF_TUNES) {
if (arg < TONE_NUMBER_OF_TUNES) {
if (arg == 0) {
// stop the tune
_tune = nullptr;

Loading…
Cancel
Save