Browse Source

bma180: add argc check

sbg
Beat Küng 7 years ago committed by Lorenz Meier
parent
commit
8f5fb3d0e5
  1. 6
      src/drivers/imu/bma180/bma180.cpp

6
src/drivers/imu/bma180/bma180.cpp

@ -890,9 +890,12 @@ info()
int int
bma180_main(int argc, char *argv[]) bma180_main(int argc, char *argv[])
{ {
if (argc < 2) {
goto out_error;
}
/* /*
* Start/load the driver. * Start/load the driver.
*/ */
if (!strcmp(argv[1], "start")) { if (!strcmp(argv[1], "start")) {
bma180::start(); bma180::start();
@ -919,5 +922,6 @@ bma180_main(int argc, char *argv[])
bma180::info(); bma180::info();
} }
out_error:
errx(1, "unrecognised command, try 'start', 'test', 'reset' or 'info'"); errx(1, "unrecognised command, try 'start', 'test', 'reset' or 'info'");
} }

Loading…
Cancel
Save