diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-03 12:34:14 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-03 12:34:14 +0000 |
commit | 2810298e69b338f019297717bd0f5732e85854f9 (patch) | |
tree | 358dbb596f830ec29b4b94ef8c9713a6fcb68f3e | |
parent | 80b1accf07574499d41d7e168dfa5d239b0b1a6d (diff) |
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: http://svn.digium.com/svn/asterisk/branches/1.2@73052 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | apps/app_dial.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c index d36677c2f..834b7dc47 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -1706,7 +1706,7 @@ static int retrydial_exec(struct ast_channel *chan, void *data) 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 @@ static int retrydial_exec(struct ast_channel *chan, void *data) 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; |