mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
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
This commit is contained in:
@@ -5644,7 +5644,7 @@ static int pbx_builtin_goto(struct ast_channel *chan, void *data)
|
||||
}
|
||||
|
||||
|
||||
int pbx_builtin_serialize_variables(struct ast_channel *chan, char *buf, size_t size)
|
||||
int pbx_builtin_serialize_variables(struct ast_channel *chan, struct ast_str **buf)
|
||||
{
|
||||
struct ast_var_t *variables;
|
||||
const char *var, *val;
|
||||
@@ -5653,13 +5653,14 @@ int pbx_builtin_serialize_variables(struct ast_channel *chan, char *buf, size_t
|
||||
if (!chan)
|
||||
return 0;
|
||||
|
||||
memset(buf, 0, size);
|
||||
(*buf)->used = 0;
|
||||
(*buf)->str[0] = '\0';
|
||||
|
||||
AST_LIST_TRAVERSE(&chan->varshead, variables, entries) {
|
||||
if ((var=ast_var_name(variables)) && (val=ast_var_value(variables))
|
||||
/* && !ast_strlen_zero(var) && !ast_strlen_zero(val) */
|
||||
) {
|
||||
if (ast_build_string(&buf, &size, "%s=%s\n", var, val)) {
|
||||
if (ast_str_append(buf, 0, "%s=%s\n", var, val) < 0) {
|
||||
ast_log(LOG_ERROR, "Data Buffer Size Exceeded!\n");
|
||||
break;
|
||||
} else
|
||||
|
Reference in New Issue
Block a user