Signed-off-by: Antoine Busque <abusque@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
/* Variables */
static char *progname,
- *opt_viewer_path = DEFAULT_VIEWER,
- *opt_output_path;
+ *opt_viewer_path = NULL,
+ *opt_output_path = NULL;
static char *input_path;
}
break;
case 'e':
+ free(opt_viewer_path);
opt_viewer_path = strdup(optarg);
break;
case 'x':
+ free(opt_output_path);
opt_output_path = strdup(optarg);
break;
case OPT_DUMP_OPTIONS:
}
}
+ if (!opt_viewer_path) {
+ opt_viewer_path = DEFAULT_VIEWER;
+ }
+
/* No leftovers, or more than one input path, print usage and quit */
if ((argc - optind) == 0 || (argc - optind) > 1) {
usage(stderr);