Skip to content
Snippets Groups Projects
Commit f7b250f9 authored by James Golovich's avatar James Golovich
Browse files

Fix command completion and remove compile time warnings

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2654 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 78641613
Branches
Tags
No related merge requests found
...@@ -992,7 +992,7 @@ static char **ast_el_strtoarr(char *buf) ...@@ -992,7 +992,7 @@ static char **ast_el_strtoarr(char *buf)
match_list = realloc(match_list, match_list_len * sizeof(char *)); match_list = realloc(match_list, match_list_len * sizeof(char *));
} }
match_list[matches++] = retstr; match_list[matches++] = strdup(retstr);
} }
if (!match_list) if (!match_list)
...@@ -1098,7 +1098,7 @@ static char *cli_complete(EditLine *el, int ch) ...@@ -1098,7 +1098,7 @@ static char *cli_complete(EditLine *el, int ch)
/* Start with a 2048 byte buffer */ /* Start with a 2048 byte buffer */
mbuf = malloc(maxmbuf); mbuf = malloc(maxmbuf);
if (!mbuf) if (!mbuf)
return (CC_ERROR); return (char *)(CC_ERROR);
snprintf(buf, sizeof(buf),"_COMMAND MATCHESARRAY \"%s\" \"%s\"", lf->buffer, ptr); snprintf(buf, sizeof(buf),"_COMMAND MATCHESARRAY \"%s\" \"%s\"", lf->buffer, ptr);
fdprint(ast_consock, buf); fdprint(ast_consock, buf);
res = 0; res = 0;
...@@ -1108,7 +1108,7 @@ static char *cli_complete(EditLine *el, int ch) ...@@ -1108,7 +1108,7 @@ static char *cli_complete(EditLine *el, int ch)
maxmbuf += 1024; maxmbuf += 1024;
mbuf = realloc(mbuf, maxmbuf); mbuf = realloc(mbuf, maxmbuf);
if (!mbuf) if (!mbuf)
return (CC_ERROR); return (char *)(CC_ERROR);
} }
/* Only read 1024 bytes at a time */ /* Only read 1024 bytes at a time */
res = read(ast_consock, mbuf + mlen, 1024); res = read(ast_consock, mbuf + mlen, 1024);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment