mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
ms5611: add argc check
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user