[asterisk-commits] tilghman: branch 1.2 r73052 - /branches/1.2/apps/app_dial.c

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


Author: tilghman
Date: Tue Jul  3 07:34:14 2007
New Revision: 73052

URL: http://svn.digium.com/view/asterisk?view=rev&rev=73052
Log:
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.2/apps/app_dial.c

Modified: branches/1.2/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/apps/app_dial.c?view=diff&rev=73052&r1=73051&r2=73052
==============================================================================
--- branches/1.2/apps/app_dial.c (original)
+++ branches/1.2/apps/app_dial.c Tue Jul  3 07:34:14 2007
@@ -1706,7 +1706,7 @@
 	if ((dialdata = strchr(announce, '|'))) {
 		*dialdata = '\0';
 		dialdata++;
-		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);
@@ -1716,7 +1716,7 @@
 		if ((dialdata = strchr(dialdata, '|'))) {
 			*dialdata = '\0';
 			dialdata++;
-			if (!(loops = atoi(dialdata))) {
+			if (sscanf(dialdata, "%d", &loops) != 1) {
 				ast_log(LOG_ERROR, "%s requires the numerical argument <loops>\n",rapp);
 				LOCAL_USER_REMOVE(u);
 				return -1;




More information about the asterisk-commits mailing list