make use of utils::strdup() and simplify

This commit is contained in:
Axel Kohlmeyer
2021-03-16 01:15:32 -04:00
parent 3d67d1eee9
commit 2f8770971c
3 changed files with 23 additions and 52 deletions

View File

@ -145,9 +145,7 @@ void Run::command(int narg, char **arg)
commands = new char*[ncommands];
ncommands = 0;
for (int i = first; i <= last; i++) {
int n = strlen(arg[i]) + 1;
commands[ncommands] = new char[n];
strcpy(commands[ncommands],arg[i]);
commands[ncommands] = utils::strdup(arg[i]);
ncommands++;
}
}