mirror of
https://github.com/whowechina/mai_pico.git
synced 2025-01-19 01:34:03 +01:00
Validate gpio in gpio command
This commit is contained in:
parent
ed44780cb2
commit
9d5165add1
Binary file not shown.
@ -449,7 +449,7 @@ static void handle_gpio(int argc, char *argv[])
|
||||
uint8_t gpio_main[8];
|
||||
for (int i = 0; i < 8; i++) {
|
||||
int gpio = cli_extract_non_neg_int(argv[i + 1], 0);
|
||||
if (gpio > 29) {
|
||||
if ((gpio < 0) || (gpio > 29)) {
|
||||
printf(usage);
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user