[Asterisk-cvs] asterisk/apps app_dial.c,1.60,1.61

citats at lists.digium.com citats at lists.digium.com
Fri Apr 2 02:48:14 CST 2004


Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/home/citats/cvs/asterisk/apps

Modified Files:
	app_dial.c 
Log Message:
Make app_dial complain if the timeout passed is non numeric 


Index: app_dial.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_dial.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- app_dial.c	19 Mar 2004 00:08:43 -0000	1.60
+++ app_dial.c	2 Apr 2004 07:47:23 -0000	1.61
@@ -668,9 +668,13 @@
 		cur = rest;
 	} while(cur);
 	
-	if (timeout && strlen(timeout))
-		to = atoi(timeout) * 1000;
-	else
+	if (timeout && strlen(timeout)) {
+		to = atoi(timeout);
+		if (to > 0)
+			to *= 1000;
+		else
+			ast_log(LOG_WARNING, "Invalid timeout specified: '%s'\n", timeout);
+	} else
 		to = -1;
 	peer = wait_for_answer(chan, outgoing, &to, &allowredir_in, &allowredir_out, &allowdisconnect);
 	if (!peer) {




More information about the svn-commits mailing list