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
This commit is contained in:
Mark Michelson
2008-04-24 20:43:03 +00:00
parent 8eee7feb2b
commit 44c157b36a

View File

@@ -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 */