diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-05-22 15:08:08 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-05-22 15:08:08 +0000 |
commit | 585e2c5f1472d9ebdfd4e33d9f8c3eec52adcd4c (patch) | |
tree | 5c90a0daac30da4d6d3d87006295c1fe70f052df /channels/chan_agent.c | |
parent | caedde3d9a8de759e828cf763e01a760671e3aca (diff) |
Use ast_strlen_zero where possible. (issue #9774 reported by eliel)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@65454 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_agent.c')
-rw-r--r-- | channels/chan_agent.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/channels/chan_agent.c b/channels/chan_agent.c index 928559bbd..603b45482 100644 --- a/channels/chan_agent.c +++ b/channels/chan_agent.c @@ -1796,7 +1796,7 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode) ast_copy_string(agent_goodbye, agentgoodbye, sizeof(agent_goodbye)); /* Set Channel Specific Login Overrides */ - if (pbx_builtin_getvar_helper(chan, "AGENTLMAXLOGINTRIES") && strlen(pbx_builtin_getvar_helper(chan, "AGENTLMAXLOGINTRIES"))) { + if (!ast_strlen_zero(pbx_builtin_getvar_helper(chan, "AGENTLMAXLOGINTRIES"))) { max_login_tries = atoi(pbx_builtin_getvar_helper(chan, "AGENTMAXLOGINTRIES")); if (max_login_tries < 0) max_login_tries = 0; @@ -1804,7 +1804,7 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode) if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "Saw variable AGENTMAXLOGINTRIES=%s, setting max_login_tries to: %d on Channel '%s'.\n",tmpoptions,max_login_tries,chan->name); } - if (pbx_builtin_getvar_helper(chan, "AGENTUPDATECDR") && !ast_strlen_zero(pbx_builtin_getvar_helper(chan, "AGENTUPDATECDR"))) { + if (!ast_strlen_zero(pbx_builtin_getvar_helper(chan, "AGENTUPDATECDR"))) { if (ast_true(pbx_builtin_getvar_helper(chan, "AGENTUPDATECDR"))) update_cdr = 1; else @@ -1813,7 +1813,7 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode) if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "Saw variable AGENTUPDATECDR=%s, setting update_cdr to: %d on Channel '%s'.\n",tmpoptions,update_cdr,chan->name); } - if (pbx_builtin_getvar_helper(chan, "AGENTGOODBYE") && !ast_strlen_zero(pbx_builtin_getvar_helper(chan, "AGENTGOODBYE"))) { + if (!ast_strlen_zero(pbx_builtin_getvar_helper(chan, "AGENTGOODBYE"))) { strcpy(agent_goodbye, pbx_builtin_getvar_helper(chan, "AGENTGOODBYE")); tmpoptions=pbx_builtin_getvar_helper(chan, "AGENTGOODBYE"); if (option_verbose > 2) @@ -1875,7 +1875,7 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode) p->lastdisc.tv_sec++; /* Set Channel Specific Agent Overrides */ - if (pbx_builtin_getvar_helper(chan, "AGENTACKCALL") && strlen(pbx_builtin_getvar_helper(chan, "AGENTACKCALL"))) { + if (!ast_strlen_zero(pbx_builtin_getvar_helper(chan, "AGENTACKCALL"))) { if (!strcasecmp(pbx_builtin_getvar_helper(chan, "AGENTACKCALL"), "always")) p->ackcall = 2; else if (ast_true(pbx_builtin_getvar_helper(chan, "AGENTACKCALL"))) @@ -1886,7 +1886,7 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode) if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "Saw variable AGENTACKCALL=%s, setting ackcall to: %d for Agent '%s'.\n",tmpoptions,p->ackcall,p->agent); } - if (pbx_builtin_getvar_helper(chan, "AGENTAUTOLOGOFF") && strlen(pbx_builtin_getvar_helper(chan, "AGENTAUTOLOGOFF"))) { + if (!ast_strlen_zero(pbx_builtin_getvar_helper(chan, "AGENTAUTOLOGOFF"))) { p->autologoff = atoi(pbx_builtin_getvar_helper(chan, "AGENTAUTOLOGOFF")); if (p->autologoff < 0) p->autologoff = 0; @@ -1894,7 +1894,7 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode) if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "Saw variable AGENTAUTOLOGOFF=%s, setting autologff to: %d for Agent '%s'.\n",tmpoptions,p->autologoff,p->agent); } - if (pbx_builtin_getvar_helper(chan, "AGENTWRAPUPTIME") && strlen(pbx_builtin_getvar_helper(chan, "AGENTWRAPUPTIME"))) { + if (!ast_strlen_zero(pbx_builtin_getvar_helper(chan, "AGENTWRAPUPTIME"))) { p->wrapuptime = atoi(pbx_builtin_getvar_helper(chan, "AGENTWRAPUPTIME")); if (p->wrapuptime < 0) p->wrapuptime = 0; |