added/fixed more checking on hardpoint set command for CLI

This commit is contained in:
blah
2016-01-20 12:30:20 -08:00
committed by Lorenz Meier
parent c98e236744
commit 7d079d1dd7
2 changed files with 10 additions and 5 deletions

View File

@@ -1383,15 +1383,18 @@ int uavcan_main(int argc, char *argv[])
// Sanity check - weed out negative values, check against maximums
if (hardpoint_id >= 0 &&
hardpoint_id < 9 &&
hardpoint_id < 256 &&
command >= 0 &&
command < 11) {
command < 65536) {
inst->hardpoint_controller_set((uint8_t) hardpoint_id, (uint16_t) command);
}
else {
errx(1, "Are you nuts?");
}
}
else {
errx(1, "Are you nuts?");
}
}
if (!std::strcmp(argv[1], "stop")) {
if (fw) {