Don't modify a variable that we don't want modified. Make a copy of it instead.

Issue 10029, patch by phsultan with slight modifications by me (to remove needless casts).


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72125 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
Jason Parker 18 years ago
parent d528f7791d
commit 7508fce25b

@ -963,15 +963,14 @@ static struct ast_channel *gtalk_new(struct gtalk *client, struct gtalk_pvt *i,
/* Don't use ast_set_callerid() here because it will
* generate a needless NewCallerID event */
if (!strcasecmp(client->name, "guest")) {
if (strchr(i->them, '/')) {
char *aux;
data = ast_strdupa((char *)i->them);
aux = data;
cid = strsep(&aux, "/");
data = ast_strdupa(i->them);
if (strchr(data, '/')) {
cid = strsep(&data, "/");
} else
cid = i->them;
cid = data;
} else {
cid = client->user;
data = ast_strdupa(client->user);
cid = data;
}
cid = strsep(&cid, "@");
tmp->cid.cid_num = ast_strdup(cid);

Loading…
Cancel
Save