]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Use asprintf to build the channel names instead of custom function. I believe the...
authorJoshua Colp <jcolp@digium.com>
Sat, 30 Dec 2006 18:19:57 +0000 (18:19 +0000)
committerJoshua Colp <jcolp@digium.com>
Sat, 30 Dec 2006 18:19:57 +0000 (18:19 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49070 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c

index 62195ee2dbb8aea19c089acbf0de81d8ab5f87d4..78c2d6f655dbedf0eb7e49d33d83755e9fdf95c5 100644 (file)
@@ -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;