pki: Make cmds array static, ensuring that it is zero-initialized
authorMartin Willi <martin@revosec.ch>
Thu, 20 Feb 2014 10:20:45 +0000 (11:20 +0100)
committerMartin Willi <martin@revosec.ch>
Thu, 20 Feb 2014 10:45:51 +0000 (11:45 +0100)
As pki --help relies on a zero-terminated array, make the actually non-public
cmds array static to ensure initialization.

src/pki/command.c

index 7ccbd96..b6966ee 100644 (file)
@@ -29,7 +29,7 @@
 /**
  * Registered commands.
  */
-command_t cmds[MAX_COMMANDS];
+static command_t cmds[MAX_COMMANDS];
 
 /**
  * active command.
@@ -274,4 +274,3 @@ int command_dispatch(int c, char *v[])
        }
        return command_usage(c > 1 ? "invalid operation" : NULL);
 }
-