diff options
-rw-r--r-- | src/firejail/join.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/firejail/join.c b/src/firejail/join.c index 98e140ce4..5a2c02d63 100644 --- a/src/firejail/join.c +++ b/src/firejail/join.c | |||
@@ -53,7 +53,7 @@ static void extract_command(int argc, char **argv, int index) { | |||
53 | int i; | 53 | int i; |
54 | // calculate command length | 54 | // calculate command length |
55 | for (i = index; i < argc; i++) { | 55 | for (i = index; i < argc; i++) { |
56 | len += strlen(argv[i]) + 1; | 56 | len += strlen(argv[i]) + 3; |
57 | } | 57 | } |
58 | assert(len > 0); | 58 | assert(len > 0); |
59 | 59 | ||
@@ -61,8 +61,9 @@ static void extract_command(int argc, char **argv, int index) { | |||
61 | cfg.command_line = malloc(len + 1); | 61 | cfg.command_line = malloc(len + 1); |
62 | *cfg.command_line = '\0'; | 62 | *cfg.command_line = '\0'; |
63 | for (i = index; i < argc; i++) { | 63 | for (i = index; i < argc; i++) { |
64 | strcat(cfg.command_line, "\""); | ||
64 | strcat(cfg.command_line, argv[i]); | 65 | strcat(cfg.command_line, argv[i]); |
65 | strcat(cfg.command_line, " "); | 66 | strcat(cfg.command_line, "\" "); |
66 | } | 67 | } |
67 | if (arg_debug) | 68 | if (arg_debug) |
68 | printf("Extracted command #%s#\n", cfg.command_line); | 69 | printf("Extracted command #%s#\n", cfg.command_line); |