diff options
author | midipix <writeonce@midipix.org> | 2015-11-29 08:41:17 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-11-10 23:35:29 -0500 |
commit | 4e7a71da4b55950d2e267118681ca7e04f019573 (patch) | |
tree | a2e57d1f14a21ef74acbb2a461afcd587734b2bd /src | |
parent | da8e21cf102f54ba05adce1cb8e59794b6c73bac (diff) | |
download | perk-4e7a71da4b55950d2e267118681ca7e04f019573.tar.bz2 perk-4e7a71da4b55950d2e267118681ca7e04f019573.tar.xz |
conformance fixes: optimized build: variable initialization and default values.
Diffstat (limited to 'src')
-rw-r--r-- | src/driver/pe_driver_ctx.c | 1 | ||||
-rw-r--r-- | src/internal/argv/argv.h | 10 |
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; |