[asterisk-commits] tilghman: branch 1.4 r73053 - in /branches/1.4: ./ apps/app_dial.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 3 07:38:54 CDT 2007


Author: tilghman
Date: Tue Jul  3 07:38:53 2007
New Revision: 73053

URL: http://svn.digium.com/view/asterisk?view=rev&rev=73053
Log:
Merged revisions 73052 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r73052 | tilghman | 2007-07-03 07:34:14 -0500 (Tue, 03 Jul 2007) | 2 lines

RetryDial should accept a 0 argument, but it does not, because atoi does not distinguish between 0 and error (closes issue #10106)

........

Modified:
    branches/1.4/   (props changed)
    branches/1.4/apps/app_dial.c

Propchange: branches/1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Modified: branches/1.4/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_dial.c?view=diff&rev=73053&r1=73052&r2=73053
==============================================================================
--- branches/1.4/apps/app_dial.c (original)
+++ branches/1.4/apps/app_dial.c Tue Jul  3 07:38:53 2007
@@ -1726,7 +1726,7 @@
 
 	if ((dialdata = strchr(announce, '|'))) {
 		*dialdata++ = '\0';
-		if ((sleep = atoi(dialdata))) {
+		if (sscanf(dialdata, "%d", &sleep) == 1) {
 			sleep *= 1000;
 		} else {
 			ast_log(LOG_ERROR, "%s requires the numerical argument <sleep>\n",rapp);
@@ -1734,7 +1734,7 @@
 		}
 		if ((dialdata = strchr(dialdata, '|'))) {
 			*dialdata++ = '\0';
-			if (!(loops = atoi(dialdata))) {
+			if (sscanf(dialdata, "%d", &loops) != 1) {
 				ast_log(LOG_ERROR, "%s requires the numerical argument <loops>\n",rapp);
 				goto done;
 			}




More information about the asterisk-commits mailing list