mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
ms5611: add argc check
This commit is contained in:
parent
7e7905acd1
commit
ae8439f0af
@ -50,7 +50,6 @@
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <unistd.h>
|
||||
#include <getopt.h>
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/wqueue.h>
|
||||
@ -1198,10 +1197,15 @@ ms5611_main(int argc, char *argv[])
|
||||
|
||||
default:
|
||||
ms5611::usage();
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (myoptind >= argc) {
|
||||
ms5611::usage();
|
||||
return -1;
|
||||
}
|
||||
|
||||
const char *verb = argv[myoptind];
|
||||
|
||||
/*
|
||||
@ -1232,5 +1236,6 @@ ms5611_main(int argc, char *argv[])
|
||||
ms5611::info();
|
||||
}
|
||||
|
||||
errx(1, "unrecognised command, try 'start', 'test', 'reset' or 'info'");
|
||||
PX4_ERR("unrecognised command, try 'start', 'test', 'reset' or 'info'");
|
||||
return -1;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user