Fixed bug with number of arguments

This commit is contained in:
Bruce Hill 2019-05-22 14:56:28 -07:00
parent 73124fedf9
commit 68cc3ecf33

2
bb.c
View File

@ -131,7 +131,7 @@ static int run_cmd_on_selection(bb_state_t *state, const char *cmd)
if ((child = fork()) == 0) {
// TODO: is there a max number of args? Should this be batched?
char **const args = calloc(MAX(1, state->nselected) + 4, sizeof(char*));
char **const args = calloc(MAX(1, state->nselected) + 5, sizeof(char*));
int i = 0;
args[i++] = "sh";
args[i++] = "-c";