[asterisk-commits] mmichelson: branch 1.4 r168598 - /branches/1.4/channels/chan_agent.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jan 14 10:19:26 CST 2009


Author: mmichelson
Date: Wed Jan 14 10:19:26 2009
New Revision: 168598

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168598
Log:
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.


Modified:
    branches/1.4/channels/chan_agent.c

Modified: branches/1.4/channels/chan_agent.c
URL: http://svn.digium.com/svn-view/asterisk/branches/1.4/channels/chan_agent.c?view=diff&rev=168598&r1=168597&r2=168598
==============================================================================
--- branches/1.4/channels/chan_agent.c (original)
+++ branches/1.4/channels/chan_agent.c Wed Jan 14 10:19:26 2009
@@ -1401,15 +1401,17 @@
 	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;




More information about the asterisk-commits mailing list