diff options
author | Luigi Rizzo <rizzo@icir.org> | 2006-12-18 15:38:50 +0000 |
---|---|---|
committer | Luigi Rizzo <rizzo@icir.org> | 2006-12-18 15:38:50 +0000 |
commit | ccebf3511ce53634e1423a3bb2995a6e47a6e27d (patch) | |
tree | 78b512e0d17d9e20a9d7d06c5df6ed451fe520af /apps | |
parent | 684e4dc3731d1047ec82aa9d24ed65588bc29210 (diff) |
convert the final clients of ast_build_string to use ast_str_*()
Now the only module left using it is chan_sip.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_dumpchan.c | 6 | ||||
-rw-r--r-- | apps/app_queue.c | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/apps/app_dumpchan.c b/apps/app_dumpchan.c index 8e42e9d39..ca7897e4e 100644 --- a/apps/app_dumpchan.c +++ b/apps/app_dumpchan.c @@ -137,7 +137,7 @@ static int serialize_showchan(struct ast_channel *c, char *buf, size_t size) static int dumpchan_exec(struct ast_channel *chan, void *data) { struct ast_module_user *u; - char vars[BUFSIZ * 4]; + struct ast_str *vars = ast_str_alloca(BUFSIZ * 4); /* XXX very large! */ char info[1024]; int level = 0; static char *line = "================================================================================"; @@ -147,10 +147,10 @@ static int dumpchan_exec(struct ast_channel *chan, void *data) if (!ast_strlen_zero(data)) level = atoi(data); - pbx_builtin_serialize_variables(chan, vars, sizeof(vars)); + pbx_builtin_serialize_variables(chan, &vars); serialize_showchan(chan, info, sizeof(info)); if (option_verbose >= level) - ast_verbose("\nDumping Info For Channel: %s:\n%s\nInfo:\n%s\nVariables:\n%s%s\n", chan->name, line, info, vars, line); + ast_verbose("\nDumping Info For Channel: %s:\n%s\nInfo:\n%s\nVariables:\n%s%s\n", chan->name, line, info, vars->str, line); ast_module_user_remove(u); diff --git a/apps/app_queue.c b/apps/app_queue.c index 9eba7e0b4..280a0f3ca 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -1565,13 +1565,15 @@ static void do_hang(struct callattempt *o) static char *vars2manager(struct ast_channel *chan, char *vars, size_t len) { - char *tmp = alloca(len); + struct ast_str *buf = ast_str_alloca(len + 1); + char *tmp; - if (pbx_builtin_serialize_variables(chan, tmp, len)) { + if (pbx_builtin_serialize_variables(chan, &buf)) { int i, j; /* convert "\n" to "\nVariable: " */ strcpy(vars, "Variable: "); + tmp = buf->str; for (i = 0, j = 10; (i < len - 1) && (j < len - 1); i++, j++) { vars[j] = tmp[i]; |