[svn-commits] file: branch 1.4 r49070 - /branches/1.4/channels/chan_zap.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Sat Dec 30 11:19:58 MST 2006


Author: file
Date: Sat Dec 30 12:19:57 2006
New Revision: 49070

URL: http://svn.digium.com/view/asterisk?view=rev&rev=49070
Log:
Use asprintf to build the channel names instead of custom function. I believe the custom function is doing some things that are not portable across all implementations. (issue #8570 reported by hterag & issue #8692 reported by nicolasg)

Modified:
    branches/1.4/channels/chan_zap.c

Modified: branches/1.4/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_zap.c?view=diff&rev=49070&r1=49069&r2=49070
==============================================================================
--- branches/1.4/channels/chan_zap.c (original)
+++ branches/1.4/channels/chan_zap.c Sat Dec 30 12:19:57 2006
@@ -5186,13 +5186,13 @@
 			free(b2);
 #ifdef HAVE_PRI
 		if (i->bearer || (i->pri && (i->sig == SIG_FXSKS)))
-			b2 = ast_safe_string_alloc("Zap/%d:%d-%d", i->pri->trunkgroup, i->channel, y);
+			asprintf(&b2, "Zap/%d:%d-%d", i->pri->trunkgroup, i->channel, y);
 		else
 #endif
 		if (i->channel == CHAN_PSEUDO)
-			b2 = ast_safe_string_alloc("Zap/pseudo-%d", ast_random());
+			asprintf(&b2, "Zap/pseudo-%ld", ast_random());
 		else	
-			b2 = ast_safe_string_alloc("Zap/%d-%d", i->channel, y);
+			asprintf(&b2, "Zap/%d-%d", i->channel, y);
 		for (x = 0; x < 3; x++) {
 			if ((index != x) && i->subs[x].owner && !strcasecmp(b2, i->subs[x].owner->name))
 				break;



More information about the svn-commits mailing list