"options", '+', 1, "read command line options from file"
};
}
+ for (i = 0; cmds[registered].line[i]; i++)
+ {
+ if (i == MAX_LINES - 1)
+ {
+ fprintf(stderr, "command '%s' specifies too many usage summary "
+ "lines, please increase MAX_LINES\n", command.cmd);
+ break;
+ }
+ }
}
registered++;
}
}
else
{
- for (i = 0; cmds[active].line[i]; i++)
+ for (i = 0; i < MAX_LINES && cmds[active].line[i]; i++)
{
if (i == 0)
{
/**
* Maximum number of usage summary lines (+1)
*/
-#define MAX_LINES 10
+#define MAX_LINES 11
typedef struct command_t command_t;
typedef struct command_option_t command_option_t;
"uri", 'u', 1, "service URI to connect to"
};
}
+ for (i = 0; cmds[registered].line[i]; i++)
+ {
+ if (i == MAX_LINES - 1)
+ {
+ fprintf(stderr, "command '%s' specifies too many usage summary "
+ "lines, please increase MAX_LINES\n", command.cmd);
+ break;
+ }
+ }
}
registered++;
}
}
else
{
- for (i = 0; cmds[active].line[i]; i++)
+ for (i = 0; i < MAX_LINES && cmds[active].line[i]; i++)
{
if (i == 0)
{
{
command_register((command_t) {
list_certs, 'x', "list-certs", "list stored certificates",
- {"[--subject <dn/san>] "
- "[--type x509|x509_ac|x509_crl|ocsp_response|pubkey]\n "
- "[--flag none|ca|aa|ocsp|any] "
- "[--pem] [--raw|--pretty|--short|--utc]"},
+ {"[--subject <dn/san>] [--pem]",
+ "[--type x509|x509_ac|x509_crl|ocsp_response|pubkey]",
+ "[--flag none|ca|aa|ocsp|any] [--raw|--pretty|--short|--utc]"},
{
{"help", 'h', 0, "show usage information"},
{"subject", 's', 1, "filter by certificate subject"},