diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2007-01-05 23:32:42 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2007-01-05 23:32:42 +0000 |
commit | cd73a483f15033a2c619e7551d8014638e05db4f (patch) | |
tree | 76ff7f6c897bdfda963986fdaacae6e6ffc39542 /main/pbx.c | |
parent | 7cb197a5b723eaf131a3534436a451669105dd8a (diff) |
const-ify some more APIs, and fix rev 49710 from branch-1.4 in a better way here
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49711 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/pbx.c')
-rw-r--r-- | main/pbx.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/main/pbx.c b/main/pbx.c index 8d8d1899d..e45495e5b 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -1407,10 +1407,11 @@ static char *func_args(char *function) return args; } -int ast_func_read(struct ast_channel *chan, char *function, char *workspace, size_t len) +int ast_func_read(struct ast_channel *chan, const char *function, char *workspace, size_t len) { - char *args = func_args(function); - struct ast_custom_function *acfptr = ast_custom_function_find(function); + char *copy = ast_strdupa(function); + char *args = func_args(copy); + struct ast_custom_function *acfptr = ast_custom_function_find(copy); if (acfptr == NULL) ast_log(LOG_ERROR, "Function %s not registered\n", function); @@ -1421,10 +1422,11 @@ int ast_func_read(struct ast_channel *chan, char *function, char *workspace, siz return -1; } -int ast_func_write(struct ast_channel *chan, char *function, const char *value) +int ast_func_write(struct ast_channel *chan, const char *function, const char *value) { - char *args = func_args(function); - struct ast_custom_function *acfptr = ast_custom_function_find(function); + char *copy = ast_strdupa(function); + char *args = func_args(copy); + struct ast_custom_function *acfptr = ast_custom_function_find(copy); if (acfptr == NULL) ast_log(LOG_ERROR, "Function %s not registered\n", function); |