Skip to content

Commit

Permalink
Merge pull request #2000 from hallyn/2017-12-04/execargs
Browse files Browse the repository at this point in the history
lxc_execute: properly figure out number of needed arguments
  • Loading branch information
Christian Brauner committed Dec 5, 2017
2 parents 68eeee2 + 858faf7 commit 4fe9a9b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lxc/execute.c
Expand Up @@ -49,14 +49,14 @@ static int execute_start(struct lxc_handler *handler, void* data)

while (my_args->argv[argc++]);

argc_add = 4;
/* lxc-init -n name -- [argc] NULL -> 5 */
argc_add = 5;
if (my_args->quiet)
argc_add++;
if (!handler->conf->rootfs.path) {
argc_add += 4;
if (lxc_log_has_valid_level())
argc_add += 2;
}
if (!handler->conf->rootfs.path)
argc_add += 2;
if (lxc_log_has_valid_level())
argc_add += 2;

argv = malloc((argc + argc_add) * sizeof(*argv));
if (!argv)
Expand Down

0 comments on commit 4fe9a9b

Please sign in to comment.