]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Add spaces when catenating chronyc command line arguments
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 12 Nov 2009 15:48:09 +0000 (16:48 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 12 Nov 2009 15:48:09 +0000 (16:48 +0100)
client.c

index bef845842388b036cb657f303f5b16401449eb95..8885d66112890999ac63f7f82702e2ad2a3055f9 100644 (file)
--- a/client.c
+++ b/client.c
@@ -2377,13 +2377,15 @@ process_args(int argc, char **argv)
 
   total_length = 0;
   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[0] = 0;
   for (i=0; i<argc; i++) {
     strcat(line, argv[i]);
+    if (i + 1 < argc)
+      strcat(line, " ");
   }
   strcat(line, "\n");