There is no need to copy the optarg string since it is a pointer
into the original argv array, not into a static area
that might be overwritten.
* strace.c (username, outfname): Add const qualifier.
(init): Do not xstrdup optarg to initialize outfname and username.
static int strace_child;
static int strace_tracer_pid;
-static char *username;
+static const char *username;
static uid_t run_uid;
static gid_t run_gid;
static int acolumn = DEFAULT_ACOLUMN;
static char *acolumn_spaces;
-static char *outfname;
+static const char *outfname;
/* If -ff, points to stderr. Else, it's our common output log */
static FILE *shared_log;
qualify(optarg);
break;
case 'o':
- outfname = xstrdup(optarg);
+ outfname = optarg;
break;
case 'O':
i = string_to_uint(optarg);
set_sortby(optarg);
break;
case 'u':
- username = xstrdup(optarg);
+ username = optarg;
break;
#ifdef USE_LIBUNWIND
case 'k':