aboutsummaryrefslogtreecommitdiffstats
path: root/cli.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-11-17 19:28:08 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-11-17 19:28:08 +0000
commita2038dfc02b8e607267583820fcd6563c8a32313 (patch)
tree9983363d956c72180b00914d2cf86509f80ad38f /cli.c
parent38b5e581d442a30432019c176f826f8e34bc7558 (diff)
Fix initialization of CLI (bug #2861)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4284 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'cli.c')
-rwxr-xr-xcli.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/cli.c b/cli.c
index 16a05b082..bf8e52272 100755
--- a/cli.c
+++ b/cli.c
@@ -936,10 +936,10 @@ int ast_cli_register(struct ast_cli_entry *e)
static int help_workhorse(int fd, char *match[])
{
- char fullcmd1[80];
- char fullcmd2[80];
+ char fullcmd1[80] = "";
+ char fullcmd2[80] = "";
char matchstr[80];
- char *fullcmd;
+ char *fullcmd = NULL;
struct ast_cli_entry *e, *e1, *e2;
e1 = builtins;
e2 = helpers;
@@ -1072,8 +1072,7 @@ normal:
int ast_cli_generatornummatches(char *text, char *word)
{
int matches = 0, i = 0;
- char *buf, *oldbuf = NULL;
-
+ char *buf = NULL, *oldbuf = NULL;
while ( (buf = ast_cli_generator(text, word, i)) ) {
if (++i > 1 && strcmp(buf,oldbuf) == 0) {
@@ -1132,10 +1131,10 @@ static char *__ast_cli_generator(char *text, char *word, int state, int lock)
int x;
int matchnum=0;
char *dup, *res;
- char fullcmd1[80];
- char fullcmd2[80];
+ char fullcmd1[80] = "";
+ char fullcmd2[80] = "";
char matchstr[80];
- char *fullcmd;
+ char *fullcmd = NULL;
if ((dup = parse_args(text, &x, argv))) {
join(matchstr, sizeof(matchstr), argv);