Add spaces when catenating chronyc command line arguments
This commit is contained in:
parent
e08870c63c
commit
0a86a8dd0b
1 changed files with 3 additions and 1 deletions
4
client.c
4
client.c
|
@ -2377,13 +2377,15 @@ process_args(int argc, char **argv)
|
||||||
|
|
||||||
total_length = 0;
|
total_length = 0;
|
||||||
for(i=0; i<argc; i++) {
|
for(i=0; i<argc; i++) {
|
||||||
total_length += strlen(argv[i]);
|
total_length += strlen(argv[i]) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
line = (char *) malloc((2 + total_length) * sizeof(char));
|
line = (char *) malloc((2 + total_length) * sizeof(char));
|
||||||
line[0] = 0;
|
line[0] = 0;
|
||||||
for (i=0; i<argc; i++) {
|
for (i=0; i<argc; i++) {
|
||||||
strcat(line, argv[i]);
|
strcat(line, argv[i]);
|
||||||
|
if (i + 1 < argc)
|
||||||
|
strcat(line, " ");
|
||||||
}
|
}
|
||||||
strcat(line, "\n");
|
strcat(line, "\n");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue