Skip to content

Commit

Permalink
trivial
Browse files Browse the repository at this point in the history
  • Loading branch information
justanhduc committed Aug 5, 2022
1 parent 3c7276d commit 406f2ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static void run_child(int fd_send_filename, const char* tmpdir) {
char *cmd;
int cmdLen = 0;

for (int i = 0; i < command_line.command.num; cmdLen += strlen(command_line.command.array[i]) + 1, i++);
for (int i = 0; i < command_line.command.num; cmdLen += strlen(command_line.command.array[i++]) + 1);
cmd = malloc(cmdLen * sizeof(char) + 1);
for (int i = 0; i < command_line.command.num; i++) {
strcat(cmd, command_line.command.array[i]);
Expand Down

0 comments on commit 406f2ab

Please sign in to comment.