pki: Print a warning if MAX_COMMANDS is too low
This commit is contained in:
@@ -140,6 +140,13 @@ void command_register(command_t command)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (registered == MAX_COMMANDS)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "unable to register command, please increase "
|
||||||
|
"MAX_COMMANDS\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
cmds[registered] = command;
|
cmds[registered] = command;
|
||||||
/* append default options, but not to --help */
|
/* append default options, but not to --help */
|
||||||
if (!active)
|
if (!active)
|
||||||
|
|||||||
Reference in New Issue
Block a user