mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 03:08:45 +00:00
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.2@73052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1706,7 +1706,7 @@ static int retrydial_exec(struct ast_channel *chan, void *data)
|
|||||||
if ((dialdata = strchr(announce, '|'))) {
|
if ((dialdata = strchr(announce, '|'))) {
|
||||||
*dialdata = '\0';
|
*dialdata = '\0';
|
||||||
dialdata++;
|
dialdata++;
|
||||||
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);
|
||||||
@@ -1716,7 +1716,7 @@ static int retrydial_exec(struct ast_channel *chan, void *data)
|
|||||||
if ((dialdata = strchr(dialdata, '|'))) {
|
if ((dialdata = strchr(dialdata, '|'))) {
|
||||||
*dialdata = '\0';
|
*dialdata = '\0';
|
||||||
dialdata++;
|
dialdata++;
|
||||||
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);
|
||||||
LOCAL_USER_REMOVE(u);
|
LOCAL_USER_REMOVE(u);
|
||||||
return -1;
|
return -1;
|
||||||
|
Reference in New Issue
Block a user