1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-18 13:55:18 +03:00

Corrected incorrect index use in resourceCheck

This commit is contained in:
blckmn 2016-11-21 12:02:19 +11:00
parent ea38aa2ca7
commit 8d771c6f5c

View file

@ -3948,10 +3948,11 @@ static void cliResource(char *cmdline)
cliShowArgumentRangeError("index", 1, resourceTable[resourceIndex].maxIndex); cliShowArgumentRangeError("index", 1, resourceTable[resourceIndex].maxIndex);
return; return;
} }
index -= 1;
} }
pch = strtok_r(NULL, " ", &saveptr); pch = strtok_r(NULL, " ", &saveptr);
ioTag_t *tag = (ioTag_t*)(resourceTable[resourceIndex].ptr + (index == 0 ? 0 : index - 1)); ioTag_t *tag = (ioTag_t*)(resourceTable[resourceIndex].ptr + index);
uint8_t pin = 0; uint8_t pin = 0;
if (strlen(pch) > 0) { if (strlen(pch) > 0) {