[asterisk-commits] russell: trunk r48951 - /trunk/funcs/func_callerid.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun Dec 24 19:31:04 MST 2006


Author: russell
Date: Sun Dec 24 20:31:04 2006
New Revision: 48951

URL: http://svn.digium.com/view/asterisk?view=rev&rev=48951
Log:
Simplify the if statements used to check to see if the argument was "num"
or "number".  It is not possible to ever reach the second part of this
conditional statement.

Thanks to my brother, Brett, for pointing this out.  :)

Modified:
    trunk/funcs/func_callerid.c

Modified: trunk/funcs/func_callerid.c
URL: http://svn.digium.com/view/asterisk/trunk/funcs/func_callerid.c?view=diff&rev=48951&r1=48950&r2=48951
==============================================================================
--- trunk/funcs/func_callerid.c (original)
+++ trunk/funcs/func_callerid.c Sun Dec 24 20:31:04 2006
@@ -54,9 +54,7 @@
 			snprintf(buf, len, "\"%s\" <%s>", name, num);
 		} else if (!strncasecmp("name", data, 4)) {
 			ast_copy_string(buf, name, len);
-		} else if (!strncasecmp("num", data, 3) ||
-			   !strncasecmp("number", data, 6)) {
-
+		} else if (!strncasecmp("num", data, 3)) {
 			ast_copy_string(buf, num, len);
 		} else {
 			ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);
@@ -70,8 +68,7 @@
 			if (chan->cid.cid_name) {
 				ast_copy_string(buf, chan->cid.cid_name, len);
 			}
-		} else if (!strncasecmp("num", data, 3)
-				   || !strncasecmp("number", data, 6)) {
+		} else if (!strncasecmp("num", data, 3)) {
 			if (chan->cid.cid_num) {
 				ast_copy_string(buf, chan->cid.cid_num, len);
 			}
@@ -113,8 +110,7 @@
 			ast_set_callerid(chan, num, name, num);
 	} else if (!strncasecmp("name", data, 4)) {
 		ast_set_callerid(chan, NULL, value, NULL);
-	} else if (!strncasecmp("num", data, 3) ||
-		   !strncasecmp("number", data, 6)) {
+	} else if (!strncasecmp("num", data, 3)) { 
 		ast_set_callerid(chan, value, NULL, NULL);
 	} else if (!strncasecmp("ani", data, 3)) {
 		ast_set_callerid(chan, NULL, NULL, value);



More information about the asterisk-commits mailing list