From: Mark Michelson Date: Thu, 24 Apr 2008 20:43:03 +0000 (+0000) Subject: Output of channel variables when eventwhencalled=vars was set X-Git-Tag: 1.4.20-rc1~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=44c157b36a330baddf18ff4ee9849f59c6d64905;p=thirdparty%2Fasterisk.git Output of channel variables when eventwhencalled=vars was set was being truncated two characters. This patch corrects the problem. (closes issue #12493) Reported by: davidw git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114628 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_queue.c b/apps/app_queue.c index 08e85c02fb..f3b331a877 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -1761,10 +1761,10 @@ static char *vars2manager(struct ast_channel *chan, char *vars, size_t len) j += 9; } } - if (j > len - 1) - j = len - 1; - vars[j - 2] = '\r'; - vars[j - 1] = '\n'; + if (j > len - 3) + j = len - 3; + vars[j++] = '\r'; + vars[j++] = '\n'; vars[j] = '\0'; } else { /* there are no channel variables; leave it blank */