aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-14 16:19:26 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-14 16:19:26 +0000
commit280044ed2c2fe53ebe679164488cfa36983f37f9 (patch)
treea5b6ad2f01e56dd04340368ec100d83fef282f15
parentb00b6253d2885eedfcd65ad7746077afefa9bbff (diff)
Fix a logic error I found while searching through chan_agent.c
I found that the allow_multiple_logins function would never return 0 due to an incorrect comparison being used when traversing the list of agents. While I was modifying this function, I also did a little bit of coding guidelines cleanup, too. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@168598 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_agent.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/channels/chan_agent.c b/channels/chan_agent.c
index daa8a9d08..b12983dfc 100644
--- a/channels/chan_agent.c
+++ b/channels/chan_agent.c
@@ -1401,15 +1401,17 @@ static int allow_multiple_login(char *chan, char *context)
struct agent_pvt *p;
char loginchan[80];
- if(multiplelogin)
+ if (multiplelogin) {
return 1;
- if(!chan)
+ }
+ if (!chan) {
return 0;
+ }
snprintf(loginchan, sizeof(loginchan), "%s@%s", chan, S_OR(context, "default"));
AST_LIST_TRAVERSE(&agents, p, list) {
- if(!strcasecmp(chan, p->loginchan))
+ if(!strcasecmp(loginchan, p->loginchan))
return 0;
}
return -1;