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: https://origsvn.digium.com/svn/asterisk/branches/1.4@168598
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
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;