don't loop forever on an invalid options string (issue #5629)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6989 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2005-11-06 22:17:47 +00:00
parent e4ce764744
commit bb3e125ed4
2 changed files with 8 additions and 9 deletions

View File

@@ -1658,13 +1658,12 @@ static struct ast_cli_entry cli_agent_logoff = {
STANDARD_LOCAL_USER;
LOCAL_USER_DECL;
/**
* Log in agent application.
/*!
* \brief Log in agent application.
*
* @param chan
* @param data
* @param callbackmode
* @returns
* \param chan
* \param data
* \param callbackmode non-zero for AgentCallbackLogin
*/
static int __login_exec(struct ast_channel *chan, void *data, int callbackmode)
{
@@ -1736,10 +1735,9 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode)
context = parse;
}
while (!ast_strlen_zero(args.options)) {
if (*args.options == 's') {
if (!ast_strlen_zero(args.options)) {
if (strchr(args.options, 's')) {
play_announcement = 0;
break;
}
}