aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_zap.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-12-30 18:19:57 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-12-30 18:19:57 +0000
commit6a8c6facc4a3a083e58441c71b9879bd943eb752 (patch)
treeed4c0aa054369815e7f8011f3ccabc9eb487dc85 /channels/chan_zap.c
parent5adf05c5d78ab5b1f0a5f9e867158ef9be3c8f99 (diff)
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)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@49070 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_zap.c')
-rw-r--r--channels/chan_zap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 62195ee2d..78c2d6f65 100644
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -5186,13 +5186,13 @@ static struct ast_channel *zt_new(struct zt_pvt *i, int state, int startpbx, int
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;