Commit a9eace30 authored by Martin Thomson's avatar Martin Thomson

Bug 1309068 - Enable -Wshadow, r=franziskus

--HG--
extra : rebase_source : eee25e22a1211223b9ba4a27a9511d9b417c9771
parent 46bcdec3
...@@ -3724,7 +3724,7 @@ main(int argc, char **argv) ...@@ -3724,7 +3724,7 @@ main(int argc, char **argv)
/* test the RSA_PopulatePrivateKey function */ /* test the RSA_PopulatePrivateKey function */
if (bltest.commands[cmd_RSAPopulate].activated) { if (bltest.commands[cmd_RSAPopulate].activated) {
unsigned int keySize = 1024; unsigned int keySize = 1024;
unsigned long exponent = 65537; unsigned long keyExponent = 65537;
int rounds = 1; int rounds = 1;
int ret = -1; int ret = -1;
...@@ -3735,12 +3735,12 @@ main(int argc, char **argv) ...@@ -3735,12 +3735,12 @@ main(int argc, char **argv)
rounds = PORT_Atoi(bltest.options[opt_Rounds].arg); rounds = PORT_Atoi(bltest.options[opt_Rounds].arg);
} }
if (bltest.options[opt_Exponent].activated) { if (bltest.options[opt_Exponent].activated) {
exponent = PORT_Atoi(bltest.options[opt_Exponent].arg); keyExponent = PORT_Atoi(bltest.options[opt_Exponent].arg);
} }
for (i = 0; i < rounds; i++) { for (i = 0; i < rounds; i++) {
printf("Running RSA Populate test round %d\n", i); printf("Running RSA Populate test round %d\n", i);
ret = doRSAPopulateTest(keySize, exponent); ret = doRSAPopulateTest(keySize, keyExponent);
if (ret != 0) { if (ret != 0) {
break; break;
} }
......
...@@ -782,17 +782,17 @@ ValidateCert(CERTCertDBHandle *handle, char *name, char *date, ...@@ -782,17 +782,17 @@ ValidateCert(CERTCertDBHandle *handle, char *name, char *date,
fprintf(stdout, "%s: certificate is valid\n", progName); fprintf(stdout, "%s: certificate is valid\n", progName);
GEN_BREAK(SECSuccess) GEN_BREAK(SECSuccess)
} else { } else {
char *name; char *nick;
CERTVerifyLogNode *node; CERTVerifyLogNode *node;
node = log->head; node = log->head;
while (node) { while (node) {
if (node->cert->nickname != NULL) { if (node->cert->nickname != NULL) {
name = node->cert->nickname; nick = node->cert->nickname;
} else { } else {
name = node->cert->subjectName; nick = node->cert->subjectName;
} }
fprintf(stderr, "%s : %s\n", name, fprintf(stderr, "%s : %s\n", nick,
SECU_Strerror(node->error)); SECU_Strerror(node->error));
CERT_DestroyCertificate(node->cert); CERT_DestroyCertificate(node->cert);
node = node->next; node = node->next;
...@@ -999,7 +999,7 @@ DeleteKey(char *nickname, secuPWData *pwdata) ...@@ -999,7 +999,7 @@ DeleteKey(char *nickname, secuPWData *pwdata)
slot = PK11_GetInternalKeySlot(); slot = PK11_GetInternalKeySlot();
if (PK11_NeedLogin(slot)) { if (PK11_NeedLogin(slot)) {
SECStatus rv = PK11_Authenticate(slot, PR_TRUE, pwdata); rv = PK11_Authenticate(slot, PR_TRUE, pwdata);
if (rv != SECSuccess) { if (rv != SECSuccess) {
SECU_PrintError(progName, "could not authenticate to token %s.", SECU_PrintError(progName, "could not authenticate to token %s.",
PK11_GetTokenName(slot)); PK11_GetTokenName(slot));
...@@ -1066,7 +1066,7 @@ PrintBuildFlags() ...@@ -1066,7 +1066,7 @@ PrintBuildFlags()
} }
static void static void
PrintSyntax(char *progName) PrintSyntax()
{ {
#define FPS fprintf(stderr, #define FPS fprintf(stderr,
FPS "Type %s -H for more detailed descriptions\n", progName); FPS "Type %s -H for more detailed descriptions\n", progName);
...@@ -1838,7 +1838,7 @@ luBuildFlags(enum usage_level ul, const char *command) ...@@ -1838,7 +1838,7 @@ luBuildFlags(enum usage_level ul, const char *command)
} }
static void static void
LongUsage(char *progName, enum usage_level ul, const char *command) LongUsage(enum usage_level ul, const char *command)
{ {
luA(ul, command); luA(ul, command);
luB(ul, command); luB(ul, command);
...@@ -1866,14 +1866,14 @@ LongUsage(char *progName, enum usage_level ul, const char *command) ...@@ -1866,14 +1866,14 @@ LongUsage(char *progName, enum usage_level ul, const char *command)
} }
static void static void
Usage(char *progName) Usage()
{ {
PR_fprintf(PR_STDERR, PR_fprintf(PR_STDERR,
"%s - Utility to manipulate NSS certificate databases\n\n" "%s - Utility to manipulate NSS certificate databases\n\n"
"Usage: %s <command> -d <database-directory> <options>\n\n" "Usage: %s <command> -d <database-directory> <options>\n\n"
"Valid commands:\n", "Valid commands:\n",
progName, progName); progName, progName);
LongUsage(progName, usage_selected, NULL); LongUsage(usage_selected, NULL);
PR_fprintf(PR_STDERR, "\n" PR_fprintf(PR_STDERR, "\n"
"%s -H <command> : Print available options for the given command\n" "%s -H <command> : Print available options for the given command\n"
"%s -H : Print complete help output of all commands and options\n" "%s -H : Print complete help output of all commands and options\n"
...@@ -2269,10 +2269,10 @@ flagArray opFlagsArray[] = ...@@ -2269,10 +2269,10 @@ flagArray opFlagsArray[] =
{ NAME_SIZE(verify_recover), CKF_VERIFY_RECOVER }, { NAME_SIZE(verify_recover), CKF_VERIFY_RECOVER },
{ NAME_SIZE(wrap), CKF_WRAP }, { NAME_SIZE(wrap), CKF_WRAP },
{ NAME_SIZE(unwrap), CKF_UNWRAP }, { NAME_SIZE(unwrap), CKF_UNWRAP },
{ NAME_SIZE(derive), CKF_DERIVE }, { NAME_SIZE(derive), CKF_DERIVE }
}; };
int opFlagsCount = sizeof(opFlagsArray) / sizeof(flagArray); int opFlagsCount = PR_ARRAY_SIZE(opFlagsArray);
flagArray attrFlagsArray[] = flagArray attrFlagsArray[] =
{ {
...@@ -2286,14 +2286,13 @@ flagArray attrFlagsArray[] = ...@@ -2286,14 +2286,13 @@ flagArray attrFlagsArray[] =
{ NAME_SIZE(insensitive), PK11_ATTR_INSENSITIVE }, { NAME_SIZE(insensitive), PK11_ATTR_INSENSITIVE },
{ NAME_SIZE(extractable), PK11_ATTR_EXTRACTABLE }, { NAME_SIZE(extractable), PK11_ATTR_EXTRACTABLE },
{ NAME_SIZE(unextractable), PK11_ATTR_UNEXTRACTABLE } { NAME_SIZE(unextractable), PK11_ATTR_UNEXTRACTABLE }
}; };
int attrFlagsCount = sizeof(attrFlagsArray) / sizeof(flagArray); int attrFlagsCount = PR_ARRAY_SIZE(attrFlagsArray);
#define MAX_STRING 30 #define MAX_STRING 30
CK_ULONG CK_ULONG
GetFlags(char *flagsString, flagArray *flagArray, int count) GetFlags(char *flagsString, flagArray *flags, int count)
{ {
CK_ULONG flagsValue = strtol(flagsString, NULL, 0); CK_ULONG flagsValue = strtol(flagsString, NULL, 0);
int i; int i;
...@@ -2303,10 +2302,10 @@ GetFlags(char *flagsString, flagArray *flagArray, int count) ...@@ -2303,10 +2302,10 @@ GetFlags(char *flagsString, flagArray *flagArray, int count)
} }
while (*flagsString) { while (*flagsString) {
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
if (strncmp(flagsString, flagArray[i].name, flagArray[i].nameSize) == if (strncmp(flagsString, flags[i].name, flags[i].nameSize) ==
0) { 0) {
flagsValue |= flagArray[i].value; flagsValue |= flags[i].value;
flagsString += flagArray[i].nameSize; flagsString += flags[i].nameSize;
if (*flagsString != 0) { if (*flagsString != 0) {
flagsString++; flagsString++;
} }
...@@ -2691,14 +2690,13 @@ certutil_main(int argc, char **argv, PRBool initialize) ...@@ -2691,14 +2690,13 @@ certutil_main(int argc, char **argv, PRBool initialize)
rv = SECU_ParseCommandLine(argc, argv, progName, &certutil); rv = SECU_ParseCommandLine(argc, argv, progName, &certutil);
if (rv != SECSuccess) if (rv != SECSuccess)
Usage(progName); Usage();
if (certutil.commands[cmd_PrintSyntax].activated) { if (certutil.commands[cmd_PrintSyntax].activated) {
PrintSyntax(progName); PrintSyntax();
} }
if (certutil.commands[cmd_PrintHelp].activated) { if (certutil.commands[cmd_PrintHelp].activated) {
int i;
char buf[2]; char buf[2];
const char *command = NULL; const char *command = NULL;
for (i = 0; i < max_cmd; i++) { for (i = 0; i < max_cmd; i++) {
...@@ -2715,7 +2713,7 @@ certutil_main(int argc, char **argv, PRBool initialize) ...@@ -2715,7 +2713,7 @@ certutil_main(int argc, char **argv, PRBool initialize)
break; break;
} }
} }
LongUsage(progName, (command ? usage_selected : usage_all), command); LongUsage((command ? usage_selected : usage_all), command);
exit(1); exit(1);
} }
...@@ -2823,7 +2821,7 @@ certutil_main(int argc, char **argv, PRBool initialize) ...@@ -2823,7 +2821,7 @@ certutil_main(int argc, char **argv, PRBool initialize)
if (certutil.options[opt_DBPrefix].arg) { if (certutil.options[opt_DBPrefix].arg) {
certPrefix = certutil.options[opt_DBPrefix].arg; certPrefix = certutil.options[opt_DBPrefix].arg;
} else { } else {
Usage(progName); Usage();
} }
} }
...@@ -2832,7 +2830,7 @@ certutil_main(int argc, char **argv, PRBool initialize) ...@@ -2832,7 +2830,7 @@ certutil_main(int argc, char **argv, PRBool initialize)
if (certutil.options[opt_SourcePrefix].arg) { if (certutil.options[opt_SourcePrefix].arg) {
srcCertPrefix = certutil.options[opt_SourcePrefix].arg; srcCertPrefix = certutil.options[opt_SourcePrefix].arg;
} else { } else {
Usage(progName); Usage();
} }
} }
...@@ -2916,7 +2914,7 @@ certutil_main(int argc, char **argv, PRBool initialize) ...@@ -2916,7 +2914,7 @@ certutil_main(int argc, char **argv, PRBool initialize)
return 255; return 255;
} }
if (commandsEntered == 0) { if (commandsEntered == 0) {
Usage(progName); Usage();
} }
if (certutil.commands[cmd_ListCerts].activated || if (certutil.commands[cmd_ListCerts].activated ||
......
...@@ -770,7 +770,7 @@ loser: ...@@ -770,7 +770,7 @@ loser:
} }
static void static void
Usage(char *progName) Usage()
{ {
fprintf(stderr, fprintf(stderr,
"Usage: %s -L [-n nickname] [-d keydir] [-P dbprefix] [-t crlType]\n" "Usage: %s -L [-n nickname] [-d keydir] [-P dbprefix] [-t crlType]\n"
...@@ -908,7 +908,7 @@ main(int argc, char **argv) ...@@ -908,7 +908,7 @@ main(int argc, char **argv)
while ((status = PL_GetNextOpt(optstate)) == PL_OPT_OK) { while ((status = PL_GetNextOpt(optstate)) == PL_OPT_OK) {
switch (optstate->option) { switch (optstate->option) {
case '?': case '?':
Usage(progName); Usage();
break; break;
case 'T': case 'T':
...@@ -1038,17 +1038,17 @@ main(int argc, char **argv) ...@@ -1038,17 +1038,17 @@ main(int argc, char **argv)
} }
if (deleteCRL && !nickName) if (deleteCRL && !nickName)
Usage(progName); Usage();
if (importCRL && !inFile) if (importCRL && !inFile)
Usage(progName); Usage();
if (showFileCRL && !inFile) if (showFileCRL && !inFile)
Usage(progName); Usage();
if ((generateCRL && !nickName) || if ((generateCRL && !nickName) ||
(modifyCRL && !inFile && !nickName)) (modifyCRL && !inFile && !nickName))
Usage(progName); Usage();
if (!(listCRL || deleteCRL || importCRL || showFileCRL || generateCRL || if (!(listCRL || deleteCRL || importCRL || showFileCRL || generateCRL ||
modifyCRL || test || erase)) modifyCRL || test || erase))
Usage(progName); Usage();
if (listCRL || showFileCRL) { if (listCRL || showFileCRL) {
readonly = PR_TRUE; readonly = PR_TRUE;
......
...@@ -577,7 +577,6 @@ Decode(void) ...@@ -577,7 +577,6 @@ Decode(void)
printf("WARNING: The DER contained %d messages.\n", numMsgs); printf("WARNING: The DER contained %d messages.\n", numMsgs);
} }
for (i = 0; i < numMsgs; i++) { for (i = 0; i < numMsgs; i++) {
SECStatus rv;
printf("crmftest: Processing cert request %d\n", i); printf("crmftest: Processing cert request %d\n", i);
certReqMsg = CRMF_CertReqMessagesGetCertReqMsgAtIndex(certReqMsgs, i); certReqMsg = CRMF_CertReqMessagesGetCertReqMsgAtIndex(certReqMsgs, i);
if (certReqMsg == NULL) { if (certReqMsg == NULL) {
......
...@@ -58,7 +58,7 @@ getPassword(PK11SlotInfo *slot, PRBool retry, void *arg) ...@@ -58,7 +58,7 @@ getPassword(PK11SlotInfo *slot, PRBool retry, void *arg)
} }
static void static void
Usage(const char *progName) Usage()
{ {
printf("Usage: %s [-r] [-f] [-i] [-d dbdir ] \n", printf("Usage: %s [-r] [-f] [-i] [-d dbdir ] \n",
progName); progName);
...@@ -96,7 +96,7 @@ main(int argc, char **argv) ...@@ -96,7 +96,7 @@ main(int argc, char **argv)
switch (optstate->option) { switch (optstate->option) {
case 'h': case 'h':
default: default:
Usage(progName); Usage();
break; break;
case 'r': case 'r':
...@@ -122,7 +122,7 @@ main(int argc, char **argv) ...@@ -122,7 +122,7 @@ main(int argc, char **argv)
} }
PL_DestroyOptState(optstate); PL_DestroyOptState(optstate);
if (optstatus == PL_OPT_BAD) if (optstatus == PL_OPT_BAD)
Usage(progName); Usage();
if (dbDir) { if (dbDir) {
char *tmp = dbDir; char *tmp = dbDir;
...@@ -181,7 +181,6 @@ main(int argc, char **argv) ...@@ -181,7 +181,6 @@ main(int argc, char **argv)
ret = SUCCESS; ret = SUCCESS;
if (doInitTest) { if (doInitTest) {
PK11SlotInfo *slot = PK11_GetInternalKeySlot(); PK11SlotInfo *slot = PK11_GetInternalKeySlot();
SECStatus rv;
int passwordSuccess = 0; int passwordSuccess = 0;
int type = CKM_DES3_CBC; int type = CKM_DES3_CBC;
SECItem keyid = { 0, NULL, 0 }; SECItem keyid = { 0, NULL, 0 };
......
...@@ -682,6 +682,7 @@ handle_connection( ...@@ -682,6 +682,7 @@ handle_connection(
} }
if (arena) { if (arena) {
PORT_FreeArena(arena, PR_FALSE); PORT_FreeArena(arena, PR_FALSE);
arena = NULL;
} }
if (!request || !request->tbsRequest || if (!request || !request->tbsRequest ||
!request->tbsRequest->requestList || !request->tbsRequest->requestList ||
...@@ -753,11 +754,11 @@ handle_connection( ...@@ -753,11 +754,11 @@ handle_connection(
{ {
PRTime now = PR_Now(); PRTime now = PR_Now();
PLArenaPool *arena = NULL;
CERTOCSPSingleResponse *sr; CERTOCSPSingleResponse *sr;
CERTOCSPSingleResponse **singleResponses; CERTOCSPSingleResponse **singleResponses;
SECItem *ocspResponse; SECItem *ocspResponse;
PORT_Assert(!arena);
arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
if (unknown) { if (unknown) {
...@@ -787,8 +788,8 @@ handle_connection( ...@@ -787,8 +788,8 @@ handle_connection(
} else { } else {
PR_Write(ssl_sock, outOcspHeader, strlen(outOcspHeader)); PR_Write(ssl_sock, outOcspHeader, strlen(outOcspHeader));
PR_Write(ssl_sock, ocspResponse->data, ocspResponse->len); PR_Write(ssl_sock, ocspResponse->data, ocspResponse->len);
PORT_FreeArena(arena, PR_FALSE);
} }
PORT_FreeArena(arena, PR_FALSE);
} }
CERT_DestroyOCSPRequest(request); CERT_DestroyOCSPRequest(request);
break; break;
...@@ -1357,7 +1358,6 @@ main(int argc, char **argv) ...@@ -1357,7 +1358,6 @@ main(int argc, char **argv)
caRevoIter = &caRevoInfos->link; caRevoIter = &caRevoInfos->link;
do { do {
PRFileDesc *inFile; PRFileDesc *inFile;
int rv = SECFailure;
SECItem crlDER; SECItem crlDER;
crlDER.data = NULL; crlDER.data = NULL;
...@@ -1413,11 +1413,9 @@ main(int argc, char **argv) ...@@ -1413,11 +1413,9 @@ main(int argc, char **argv)
if (provideOcsp) { if (provideOcsp) {
if (caRevoInfos) { if (caRevoInfos) {
PRCList *caRevoIter;
caRevoIter = &caRevoInfos->link; caRevoIter = &caRevoInfos->link;
do { do {
caRevoInfo *revoInfo = (caRevoInfo *)caRevoIter; revoInfo = (caRevoInfo *)caRevoIter;
if (revoInfo->nickname) if (revoInfo->nickname)
PORT_Free(revoInfo->nickname); PORT_Free(revoInfo->nickname);
if (revoInfo->crlFilename) if (revoInfo->crlFilename)
......
...@@ -1528,9 +1528,9 @@ SECU_PrintDumpDerIssuerAndSerial(FILE *out, SECItem *der, char *m, ...@@ -1528,9 +1528,9 @@ SECU_PrintDumpDerIssuerAndSerial(FILE *out, SECItem *der, char *m,
unsigned int i; unsigned int i;
for (i = 0; i < c->serialNumber.len; ++i) { for (i = 0; i < c->serialNumber.len; ++i) {
unsigned char *chardata = (unsigned char *)(c->serialNumber.data); unsigned char *chardata = (unsigned char *)(c->serialNumber.data);
unsigned char c = *(chardata + i); unsigned char ch = *(chardata + i);
fprintf(out, "\\x%02x", c); fprintf(out, "\\x%02x", ch);
} }
fprintf(out, "\" }\n"); fprintf(out, "\" }\n");
} }
...@@ -3137,7 +3137,7 @@ typedef enum { ...@@ -3137,7 +3137,7 @@ typedef enum {
static int static int
secu_PrintSignedDataSigOpt(FILE *out, SECItem *der, const char *m, secu_PrintSignedDataSigOpt(FILE *out, SECItem *der, const char *m,
int level, SECU_PPFunc inner, int level, SECU_PPFunc inner,
SignatureOptionType withSignature) SignatureOptionType signatureOption)
{ {
PLArenaPool *arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); PLArenaPool *arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
CERTSignedData *sd; CERTSignedData *sd;
...@@ -3164,7 +3164,7 @@ secu_PrintSignedDataSigOpt(FILE *out, SECItem *der, const char *m, ...@@ -3164,7 +3164,7 @@ secu_PrintSignedDataSigOpt(FILE *out, SECItem *der, const char *m,
} }
rv = (*inner)(out, &sd->data, "Data", level + 1); rv = (*inner)(out, &sd->data, "Data", level + 1);
if (withSignature) { if (signatureOption == withSignature) {
SECU_PrintAlgorithmID(out, &sd->signatureAlgorithm, "Signature Algorithm", SECU_PrintAlgorithmID(out, &sd->signatureAlgorithm, "Signature Algorithm",
level + 1); level + 1);
DER_ConvertBitString(&sd->signature); DER_ConvertBitString(&sd->signature);
......
...@@ -64,9 +64,7 @@ main(int argc, char **argv) ...@@ -64,9 +64,7 @@ main(int argc, char **argv)
/* disable all the SSL3 cipher suites */ /* disable all the SSL3 cipher suites */
for (i = 0; i < SSL_NumImplementedCiphers; i++) { for (i = 0; i < SSL_NumImplementedCiphers; i++) {
PRUint16 suite = cipherSuites[i]; PRUint16 suite = cipherSuites[i];
SECStatus rv;
PRBool enabled; PRBool enabled;
PRErrorCode err;
SSLCipherSuiteInfo info; SSLCipherSuiteInfo info;
rv = SSL_CipherPrefGetDefault(suite, &enabled); rv = SSL_CipherPrefGetDefault(suite, &enabled);
......
...@@ -390,7 +390,7 @@ testSHA512(NSSLOWInitContext *initCtx) ...@@ -390,7 +390,7 @@ testSHA512(NSSLOWInitContext *initCtx)
} }
static void static void
Usage(char *progName) Usage()
{ {
fprintf(stderr, "Usage: %s [algorithm]\n", fprintf(stderr, "Usage: %s [algorithm]\n",
progName); progName);
...@@ -436,7 +436,7 @@ main(int argc, char **argv) ...@@ -436,7 +436,7 @@ main(int argc, char **argv)
rv += testSHA512(initCtx); rv += testSHA512(initCtx);
} else { } else {
SECU_PrintError(progName, "Unsupported hash type %s\n", argv[0]); SECU_PrintError(progName, "Unsupported hash type %s\n", argv[0]);
Usage(progName); Usage();
} }
NSSLOW_Shutdown(initCtx); NSSLOW_Shutdown(initCtx);
......
...@@ -88,11 +88,11 @@ static const char* errString[] = { ...@@ -88,11 +88,11 @@ static const char* errString[] = {
static char* PR_Strdup(const char* str); static char* PR_Strdup(const char* str);
#define PAD(x) \ #define PAD(x) \
{ \ { \
int i; \ int pad_i; \
for (i = 0; i < x; i++) \ for (pad_i = 0; pad_i < (x); pad_i++) \
printf(" "); \ printf(" "); \
} }
#define PADINC 4 #define PADINC 4
......
...@@ -375,14 +375,14 @@ void reason(char *fmt, ...); ...@@ -375,14 +375,14 @@ void reason(char *fmt, ...);
char g_intbuf[4096]; /* buffer for integer comparison */ char g_intbuf[4096]; /* buffer for integer comparison */
char a_intbuf[4096]; /* buffer for integer comparison */ char a_intbuf[4096]; /* buffer for integer comparison */
int g_verbose = 1; /* print out reasons for failure? */ int g_verbose = 1; /* print out reasons for failure? */
int res;
#define IFOK(x) \
#define IFOK(x) \ { \
{ \ int ifok_res = (x); \
if (MP_OKAY > (res = (x))) { \ if (MP_OKAY > ifok_res) { \
reason("test %s failed: error %d\n", #x, res); \ reason("test %s failed: error %d\n", #x, ifok_res); \
return 1; \ return 1; \
} \ } \
} }
int int
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
char *program_name; char *program_name;
static void static void
synopsis(char *program_name) synopsis(char *progname)
{ {
PRFileDesc *pr_stderr; PRFileDesc *pr_stderr;
...@@ -46,44 +46,44 @@ synopsis(char *program_name) ...@@ -46,44 +46,44 @@ synopsis(char *program_name)
PR_fprintf(pr_stderr, "Usage:"); PR_fprintf(pr_stderr, "Usage:");
PR_fprintf(pr_stderr, PR_fprintf(pr_stderr,
"\t%s -p [-d <dir>]\n", "\t%s -p [-d <dir>]\n",
program_name); progname);
PR_fprintf(pr_stderr, PR_fprintf(pr_stderr,
"\t%s -P [-d <dir>]\n", "\t%s -P [-d <dir>]\n",
program_name); progname);
PR_fprintf(pr_stderr, PR_fprintf(pr_stderr,
"\t%s -r <name> [-a] [-L] [-s <name>] [-d <dir>]\n", "\t%s -r <name> [-a] [-L] [-s <name>] [-d <dir>]\n",
program_name); progname);
PR_fprintf(pr_stderr, PR_fprintf(pr_stderr,
"\t%s -R <name> [-a] [-l <location>] [-s <name>] [-d <dir>]\n", "\t%s -R <name> [-a] [-l <location>] [-s <name>] [-d <dir>]\n",
program_name); progname);
PR_fprintf(pr_stderr, PR_fprintf(pr_stderr,
"\t%s -S <name> [-a] [-l <location> -t <name>]\n", "\t%s -S <name> [-a] [-l <location> -t <name>]\n",
program_name); progname);
PR_fprintf(pr_stderr, PR_fprintf(pr_stderr,
"\t\t [-s <name>] [-w <time>] [-d <dir>]\n"); "\t\t [-s <name>] [-w <time>] [-d <dir>]\n");
PR_fprintf(pr_stderr, PR_fprintf(pr_stderr,
"\t%s -V <name> [-a] -u <usage> [-l <location> -t <name>]\n", "\t%s -V <name> [-a] -u <usage> [-l <location> -t <name>]\n",
program_name); progname);
PR_fprintf(pr_stderr, PR_fprintf(pr_stderr,
"\t\t [-s <name>] [-w <time>] [-d <dir>]\n"); "\t\t [-s <name>] [-w <time>] [-d <dir>]\n");
} }
static void static void
short_usage(char *program_name) short_usage(char *progname)
{ {
PR_fprintf(PR_STDERR, PR_fprintf(PR_STDERR,
"Type %s -H for more detailed descriptions\n", "Type %s -H for more detailed descriptions\n",
program_name); progname);
synopsis(program_name); synopsis(progname);
} }
static void static void
long_usage(char *program_name) long_usage(char *progname)
{ {
PRFileDesc *pr_stderr; PRFileDesc *pr_stderr;
pr_stderr = PR_STDERR; pr_stderr = PR_STDERR;
synopsis(program_name); synopsis(progname);
PR_fprintf(pr_stderr, "\nCommands (must specify exactly one):\n"); PR_fprintf(pr_stderr, "\nCommands (must specify exactly one):\n");
PR_fprintf(pr_stderr, PR_fprintf(pr_stderr,
" %-13s Pretty-print a binary request read from stdin\n", " %-13s Pretty-print a binary request read from stdin\n",
......
...@@ -194,8 +194,8 @@ main(int argc, char **argv) ...@@ -194,8 +194,8 @@ main(int argc, char **argv)