diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-14 23:01:01 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-14 23:01:01 +0000 |
commit | 7a0fe5c93f93c827215ac7ed613130434c77e649 (patch) | |
tree | ca14014e3c226332296ae0d687f996e9d8dfe6b2 /main/cli.c | |
parent | e95289a0e951770a0233260e49add9df9b20d97a (diff) |
Convert uses of strdup() to ast_strdup()
(issue #9983, eliel)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@69436 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/cli.c')
-rw-r--r-- | main/cli.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/main/cli.c b/main/cli.c index fa30bf3e5..e2ddeb3c8 100644 --- a/main/cli.c +++ b/main/cli.c @@ -105,7 +105,7 @@ static char *complete_fn(const char *word, int state) if (c && word[0] != '/') c += (strlen(ast_config_AST_MODULE_DIR) + 1); - return c ? strdup(c) : c; + return c ? ast_strdup(c) : c; } static char *handle_load(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) @@ -693,7 +693,7 @@ static char *handle_core_set_debug_channel(struct ast_cli_entry *e, int cmd, str /* XXX remember to handle the optional "off" */ if (a->pos != e->args) return NULL; - return a->n == 0 ? strdup("all") : ast_complete_channels(a->line, a->word, a->pos, a->n - 1, e->args); + return a->n == 0 ? ast_strdup("all") : ast_complete_channels(a->line, a->word, a->pos, a->n - 1, e->args); } /* 'core set debug channel {all|chan_id}' */ if (a->argc == e->args + 2) { @@ -1027,7 +1027,7 @@ static int set_full_cmd(struct ast_cli_entry *e) char buf[80]; ast_join(buf, sizeof(buf), e->cmda); - e->_full_cmd = strdup(buf); + e->_full_cmd = ast_strdup(buf); if (!e->_full_cmd) { ast_log(LOG_WARNING, "-- cannot allocate <%s>\n", buf); return -1; @@ -1144,7 +1144,7 @@ static char *is_prefix(const char *word, const char *token, if (strncasecmp(token, word, lw)) /* no match */ return NULL; *actual = 1; - return (pos != 0) ? NULL : strdup(token); + return (pos != 0) ? NULL : ast_strdup(token); } /* now handle regexp match */ @@ -1158,7 +1158,7 @@ static char *is_prefix(const char *word, const char *token, continue; (*actual)++; if (pos-- == 0) - return strdup(s); + return ast_strdup(s); } return NULL; } |