mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 06:53:34 +08:00
ms5611: add argc check
This commit is contained in:
@@ -50,7 +50,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <getopt.h>
|
|
||||||
|
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/wqueue.h>
|
#include <nuttx/wqueue.h>
|
||||||
@@ -1198,10 +1197,15 @@ ms5611_main(int argc, char *argv[])
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
ms5611::usage();
|
ms5611::usage();
|
||||||
exit(0);
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (myoptind >= argc) {
|
||||||
|
ms5611::usage();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
const char *verb = argv[myoptind];
|
const char *verb = argv[myoptind];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1232,5 +1236,6 @@ ms5611_main(int argc, char *argv[])
|
|||||||
ms5611::info();
|
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