From 511ce6b2bf9a0e4013f7c8b8e882057c8e737ea3 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Fri, 31 Oct 2008 09:31:10 +0000 Subject: [PATCH] Use the ast_str API call to reset the string instead of manually editing its internals (closes issue #13816) Reported by: eliel Patches: channel.c.patch uploaded by eliel (license 64) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153057 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/channel.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main/channel.c b/main/channel.c index fd496e5f0a..6ace4c008e 100644 --- a/main/channel.c +++ b/main/channel.c @@ -363,8 +363,7 @@ int ast_channel_trace_serialize(struct ast_channel *chan, struct ast_str **buf) return total; } traced = store->data; - (*buf)->used = 0; - (*buf)->str[0] = '\0'; + ast_str_reset(*buf); AST_LIST_TRAVERSE(&traced->trace, trace, entry) { if (ast_str_append(buf, 0, "[%d] => %s, %s, %d\n", total, trace->context, trace->exten, trace->priority) < 0) { ast_log(LOG_ERROR, "Data Buffer Size Exceeded!\n");