Bluetooth: ISO: Shell: Fix underflow of count for TX
The cmd_broadcast and cmd_send both should not take a
count value less than 1.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
diff --git a/subsys/bluetooth/host/shell/iso.c b/subsys/bluetooth/host/shell/iso.c
index 3b6340c..9113859 100644
--- a/subsys/bluetooth/host/shell/iso.c
+++ b/subsys/bluetooth/host/shell/iso.c
@@ -10,6 +10,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
+#include <stddef.h>
#include <stdlib.h>
#include <ctype.h>
#include <zephyr/kernel.h>
@@ -557,6 +558,12 @@
return -ENOEXEC;
}
+
+ if (count < 1) {
+ shell_error(sh, "Cannot send 0 times");
+
+ return -ENOEXEC;
+ }
}
if (!iso_chan.iso) {
@@ -673,6 +680,12 @@
return -ENOEXEC;
}
+
+ if (count < 1) {
+ shell_error(sh, "Cannot send 0 times");
+
+ return -ENOEXEC;
+ }
}
if (!bis_iso_chan.iso) {