use max args in all places that need it

This commit is contained in:
Isaac Shoebottom 2023-09-29 15:01:04 -03:00
parent 50289cd303
commit d0db730758

View File

@ -85,7 +85,7 @@ void exec() {
print_prompt("Please input exec subcommand:\n"); print_prompt("Please input exec subcommand:\n");
char *buffer = calloc(100, sizeof(char)); // input buffer size 100 char *buffer = calloc(100, sizeof(char)); // input buffer size 100
char **subcommand = calloc(6, sizeof(char *)); //size 6 to allow for 5 arguments and a null pointer char **subcommand = calloc(MAX_ARGS, sizeof(char *)); //size 6 to allow for 5 arguments and a null pointer
for (int i = 0; i < MAX_ARGS; i++) { for (int i = 0; i < MAX_ARGS; i++) {
subcommand[i] = NULL; //make sure each pointer is a null pointer subcommand[i] = NULL; //make sure each pointer is a null pointer
} }