[asterisk-commits] qwell: branch 1.4 r72125 - /branches/1.4/channels/chan_gtalk.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 27 12:10:33 CDT 2007


Author: qwell
Date: Wed Jun 27 12:10:32 2007
New Revision: 72125

URL: http://svn.digium.com/view/asterisk?view=rev&rev=72125
Log:
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).

Modified:
    branches/1.4/channels/chan_gtalk.c

Modified: branches/1.4/channels/chan_gtalk.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_gtalk.c?view=diff&rev=72125&r1=72124&r2=72125
==============================================================================
--- branches/1.4/channels/chan_gtalk.c (original)
+++ branches/1.4/channels/chan_gtalk.c Wed Jun 27 12:10:32 2007
@@ -963,15 +963,14 @@
 	/* 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);




More information about the asterisk-commits mailing list