[Asterisk-cvs] asterisk/apps app_dial.c,1.93,1.94

markster at lists.digium.com markster at lists.digium.com
Wed Sep 22 01:15:30 CDT 2004


Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv17494/apps

Modified Files:
	app_dial.c 
Log Message:
Handle arbitrary long dial sequences (like what we need at Astricon)


Index: app_dial.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_dial.c,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -d -r1.93 -r1.94
--- app_dial.c	10 Sep 2004 02:31:30 -0000	1.93
+++ app_dial.c	22 Sep 2004 05:19:06 -0000	1.94
@@ -3,9 +3,9 @@
  *
  * Trivial application to dial a channel and send an URL on answer
  * 
- * Copyright (C) 1999, Mark Spencer
+ * Copyright (C) 1999-2004, Digium, Inc.
  *
- * Mark Spencer <markster at linux-support.net>
+ * Mark Spencer <markster at digium.com>
  *
  * This program is free software, distributed under the terms of
  * the GNU General Public License
@@ -411,7 +411,7 @@
 {
 	int res=-1;
 	struct localuser *u;
-	char info[256], *peers, *timeout, *tech, *number, *rest, *cur;
+	char *info, *peers, *timeout, *tech, *number, *rest, *cur;
 	char  privdb[256] = "", *s;
 	char  announcemsg[256] = "", *ann;
 	struct localuser *outgoing=NULL, *tmp;
@@ -462,10 +462,13 @@
 		ast_log(LOG_WARNING, "Dial requires an argument (technology1/number1&technology2/number2...|optional timeout|options)\n");
 		return -1;
 	}
-	
+
+	if (!(info = ast_strdupa(data))) {
+		ast_log(LOG_WARNING, "Unable to dupe data :(\n");
+		return -1;
+	}
 	LOCAL_USER_ADD(u);
 	
-	strncpy(info, (char *)data, sizeof(info) - 1);
 	peers = info;
 	if (peers) {
 		




More information about the svn-commits mailing list