summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/driver/pe_driver_ctx.c1
-rw-r--r--src/internal/argv/argv.h10
2 files changed, 9 insertions, 2 deletions
diff --git a/src/driver/pe_driver_ctx.c b/src/driver/pe_driver_ctx.c
index 92a025d..6699fcc 100644
--- a/src/driver/pe_driver_ctx.c
+++ b/src/driver/pe_driver_ctx.c
@@ -143,6 +143,7 @@ int pe_get_driver_ctx(
output = 0;
pretty = 0;
nunits = 0;
+ fdout = 0;
program = argv_program_name(argv[0]);
if (!argv[1] && (flags & PERK_DRIVER_VERBOSITY_USAGE))
diff --git a/src/internal/argv/argv.h b/src/internal/argv/argv.h
index 14146ed..36615f6 100644
--- a/src/internal/argv/argv.h
+++ b/src/internal/argv/argv.h
@@ -619,6 +619,8 @@ static void argv_usage(
char * paradigm;
char * buf;
size_t buflen;
+ const char * sdescription;
+ const char * sargname;
const char indent[] = " ";
const int rblen = sizeof("}") - sizeof(char);
@@ -684,6 +686,7 @@ static void argv_usage(
paradigm = next_para = buf = 0;
fnewline = false;
rparalen = 0;
+ mparalen = 0;
for (option=options,buflen=0,rdesclen=1; option->short_name || option->long_name; option++) {
if (option->paradigm) {
@@ -693,10 +696,13 @@ static void argv_usage(
rparalen = strlen(option->paradigm) - 2*rblen;
}
+ sdescription = option->description ? option->description : "";
+ sargname = option->argname ? option->argname : "";
+
if (option->paradigm)
- rdesclen = snprintf(buf,buflen,option->description,option->paradigm);
+ rdesclen = snprintf(buf,buflen,sdescription,option->paradigm);
else
- rdesclen = snprintf(buf,buflen,option->description,option->argname);
+ rdesclen = snprintf(buf,buflen,sdescription,sargname);
if (fnewline)
(void)0;