Skip to content
Snippets Groups Projects
Commit e8d274ce authored by burneykb's avatar burneykb
Browse files

Adding argc checking to getpid and setpid

parent f8769e85
No related branches found
No related tags found
No related merge requests found
......@@ -42,7 +42,7 @@ int cli_getpid(struct backend_conn * conn, int argc, char **argv) {
}
}
if(needHelp) {
if (needHelp) {
printf("Getpid gets the p, i , or d constant values of any single controller\n");
printf("Usage Syntax : \n\t./Cli getpid controller [options...]\n");
printf("Symlink Usage Syntax : \n\t./getpid controller [options...]\n\n");
......@@ -57,6 +57,11 @@ int cli_getpid(struct backend_conn * conn, int argc, char **argv) {
return 0;
}
if (argc < 2) {
printf("Incorrect Usage, run './cli getpid --help' for correct usage.\n");
return 1;
}
int result;
if(getAll) {
pid_data.controller = PID_ROLL;
......
......@@ -73,6 +73,11 @@ int cli_setpid(struct backend_conn * conn, int argc, char **argv) {
return 0;
}
if (argc < 2) {
printf("Incorrect Usage, run './cli setpid --help' for correct usage.\n");
return 1;
}
if (setRoll) {
pid_data.controller = PID_ROLL;
} else if (setYaw) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment