summaryrefslogtreecommitdiff
path: root/src/internal
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2015-11-29 08:41:17 -0500
committermidipix <writeonce@midipix.org>2016-11-10 23:35:29 -0500
commit4e7a71da4b55950d2e267118681ca7e04f019573 (patch)
treea2e57d1f14a21ef74acbb2a461afcd587734b2bd /src/internal
parentda8e21cf102f54ba05adce1cb8e59794b6c73bac (diff)
downloadperk-4e7a71da4b55950d2e267118681ca7e04f019573.tar.bz2
perk-4e7a71da4b55950d2e267118681ca7e04f019573.tar.xz
conformance fixes: optimized build: variable initialization and default values.
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/argv/argv.h10
1 files changed, 8 insertions, 2 deletions
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;