summaryrefslogtreecommitdiff
path: root/main/cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/cli.c')
-rw-r--r--main/cli.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/main/cli.c b/main/cli.c
index 7f1b67d58..09d37a049 100644
--- a/main/cli.c
+++ b/main/cli.c
@@ -1437,8 +1437,7 @@ char **ast_cli_completion_matches(const char *text, const char *word)
if (!(retstr = ast_malloc(max_equal + 1)))
return NULL;
- strncpy(retstr, match_list[1], max_equal);
- retstr[max_equal] = '\0';
+ ast_copy_string(retstr, match_list[1], max_equal + 1);
match_list[0] = retstr;
/* ensure that the array is NULL terminated */