summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/src/ble.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/src/ble.c b/app/src/ble.c
index b15a079..a9f2afe 100644
--- a/app/src/ble.c
+++ b/app/src/ble.c
@@ -7,6 +7,7 @@
#include <device.h>
#include <init.h>
+#include <errno.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
@@ -250,6 +251,10 @@ static int ble_save_profile() {
}
int zmk_ble_prof_select(uint8_t index) {
+ if (index >= PROFILE_COUNT) {
+ return -ERANGE;
+ }
+
LOG_DBG("profile %d", index);
if (active_profile == index) {
return 0;