[asterisk-commits] trunk r21817 - /trunk/channels/chan_features.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Apr 21 03:38:01 MST 2006


Author: rizzo
Date: Fri Apr 21 05:37:59 2006
New Revision: 21817

URL: http://svn.digium.com/view/asterisk?rev=21817&view=rev
Log:
ast_strdup can handle NULL args well, so use it.


Modified:
    trunk/channels/chan_features.c

Modified: trunk/channels/chan_features.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_features.c?rev=21817&r1=21816&r2=21817&view=diff
==============================================================================
--- trunk/channels/chan_features.c (original)
+++ trunk/channels/chan_features.c Fri Apr 21 05:37:59 2006
@@ -327,25 +327,10 @@
 		ast_mutex_lock(&p->lock);
 		x = indexof(p, ast, 0);
 		if (!x && p->subchan) {
-			if (p->owner->cid.cid_num)
-				p->subchan->cid.cid_num = strdup(p->owner->cid.cid_num);
-			else 
-				p->subchan->cid.cid_num = NULL;
-		
-			if (p->owner->cid.cid_name)
-				p->subchan->cid.cid_name = strdup(p->owner->cid.cid_name);
-			else 
-				p->subchan->cid.cid_name = NULL;
-		
-			if (p->owner->cid.cid_rdnis)
-				p->subchan->cid.cid_rdnis = strdup(p->owner->cid.cid_rdnis);
-			else
-				p->subchan->cid.cid_rdnis = NULL;
-		
-			if (p->owner->cid.cid_ani)
-				p->subchan->cid.cid_ani = strdup(p->owner->cid.cid_ani);
-			else
-				p->subchan->cid.cid_ani = NULL;
+			p->subchan->cid.cid_num = ast_strdup(p->owner->cid.cid_num);
+			p->subchan->cid.cid_name = ast_strdup(p->owner->cid.cid_name);
+			p->subchan->cid.cid_rdnis = ast_strdup(p->owner->cid.cid_rdnis);
+			p->subchan->cid.cid_ani = ast_strdup(p->owner->cid.cid_ani);
 		
 			p->subchan->cid.cid_pres = p->owner->cid.cid_pres;
 			ast_string_field_set(p->subchan, language, p->owner->language);



More information about the asterisk-commits mailing list