]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/proctitle.c
Fastbuf: fbmulti: *'s and whitespace
[libucw.git] / ucw / proctitle.c
index 8810b0bfceb1b16200a702538f726f8a910dc217..82a0b8eda3433b6d5c271535eadacb3400f6b961 100644 (file)
@@ -53,8 +53,12 @@ setproctitle_init(int argc, char **argv)
     if (spt_end+1 == oldenv[i])
       spt_end = oldenv[i] + strlen(oldenv[i]);
 
     if (spt_end+1 == oldenv[i])
       spt_end = oldenv[i] + strlen(oldenv[i]);
 
+  /* Copy all arguments */
+  for (i=0; i<argc; i++)
+    argv[i] = xstrdup(argv[i]);
+
   /* Recalculate program_invocation_name, otherwise syslog() will be confused. */
   /* Recalculate program_invocation_name, otherwise syslog() will be confused. */
-  char *name = xstrdup(argv[0]);
+  char *name = argv[0];
   program_invocation_name = name;
   char *p = strrchr(name, '/');
   if (p)
   program_invocation_name = name;
   char *p = strrchr(name, '/');
   if (p)