27 int size;
28 char **cmd1 = (char **)malloc(MAX_CMD);
29 char **cmd2 = (char **)malloc(MAX_CMD);
30 switch ((int)ctx->last_comm_op) 31 {
32 case LM_AND:
33 split_string_subs(ctx->last_comm, "&&", array_string);
146 char **cmd1 = (char **)malloc(MAX_CMD);
147 char **cmd2 = (char **)malloc(MAX_CMD);
148
149 switch ((int)ctx->last_comm_op)150 {
151 case LM_AND:
152 split_string_subs(line, "&&", array_string);
Default case provides switch statements with fallback, and in general is a good to have. Hence consider adding default case to switch.
int x = 10;
switch x {
case 1: {
printf("You chose 1.");
break;
}
case 2: {
printf("You chose 2.");
break;
}
}
int x = 10;
switch x {
case 1: {
printf("You chose 1.");
break;
}
case 2: {
printf("You chose 2.");
break;
}
default: {
printf("Invalid choice!");
break;
}
}