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)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2007-07-03 12:38:53 +00:00
parent 1e392965f4
commit 3a215d6a50

View File

@@ -1726,7 +1726,7 @@ static int retrydial_exec(struct ast_channel *chan, void *data)
if ((dialdata = strchr(announce, '|'))) { if ((dialdata = strchr(announce, '|'))) {
*dialdata++ = '\0'; *dialdata++ = '\0';
if ((sleep = atoi(dialdata))) { if (sscanf(dialdata, "%d", &sleep) == 1) {
sleep *= 1000; sleep *= 1000;
} else { } else {
ast_log(LOG_ERROR, "%s requires the numerical argument <sleep>\n",rapp); ast_log(LOG_ERROR, "%s requires the numerical argument <sleep>\n",rapp);
@@ -1734,7 +1734,7 @@ static int retrydial_exec(struct ast_channel *chan, void *data)
} }
if ((dialdata = strchr(dialdata, '|'))) { if ((dialdata = strchr(dialdata, '|'))) {
*dialdata++ = '\0'; *dialdata++ = '\0';
if (!(loops = atoi(dialdata))) { if (sscanf(dialdata, "%d", &loops) != 1) {
ast_log(LOG_ERROR, "%s requires the numerical argument <loops>\n",rapp); ast_log(LOG_ERROR, "%s requires the numerical argument <loops>\n",rapp);
goto done; goto done;
} }