diff options
Diffstat (limited to 'main/cli.c')
-rw-r--r-- | main/cli.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/main/cli.c b/main/cli.c index d80738d66..5e2d2e180 100644 --- a/main/cli.c +++ b/main/cli.c @@ -1705,8 +1705,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 */ |