From: Mark Spencer Date: Sun, 6 Jun 2004 17:36:57 +0000 (+0000) Subject: Can't use the same buffer to snprintf that we're grabbing X-Git-Tag: 1.0.0-rc1~299 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1155666693dd605c3868494f7c8c1c4b8296e39;p=thirdparty%2Fasterisk.git Can't use the same buffer to snprintf that we're grabbing git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3156 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_chanisavail.c b/apps/app_chanisavail.c index 1c21af48bd..a77777334a 100755 --- a/apps/app_chanisavail.c +++ b/apps/app_chanisavail.c @@ -54,7 +54,7 @@ static int chanavail_exec(struct ast_channel *chan, void *data) { int res=-1; struct localuser *u; - char info[512], *peers, *tech, *number, *rest, *cur; + char info[512], tmp[512], *peers, *tech, *number, *rest, *cur; struct ast_channel *tempchan; if (!data) { @@ -85,8 +85,8 @@ static int chanavail_exec(struct ast_channel *chan, void *data) if ((tempchan = ast_request(tech, chan->nativeformats, number))) { pbx_builtin_setvar_helper(chan, "AVAILCHAN", tempchan->name); /* Store the originally used channel too */ - snprintf(info, sizeof(info), "%s/%s", tech, number); - pbx_builtin_setvar_helper(chan, "AVAILORIGCHAN", info); + snprintf(tmp, sizeof(tmp), "%s/%s", tech, number); + pbx_builtin_setvar_helper(chan, "AVAILORIGCHAN", tmp); ast_hangup(tempchan); tempchan = NULL; res = 1;