From: Luigi Rizzo Date: Tue, 9 May 2006 13:55:33 +0000 (+0000) Subject: remove duplicate atof() invokation X-Git-Tag: 1.4.0-beta1~1460 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dee114ccf117188c316724fbc8e10901d67fa1b8;p=thirdparty%2Fasterisk.git remove duplicate atof() invokation git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@26055 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/pbx.c b/pbx.c index 8ccd3f5290..4662d79c2a 100644 --- a/pbx.c +++ b/pbx.c @@ -4950,8 +4950,8 @@ static int pbx_builtin_wait(struct ast_channel *chan, void *data) int ms; /* Wait for "n" seconds */ - if (data && atof(data)) { - ms = atof(data) * 1000; + if (data && (ms = atof(data)) > 0) { + ms *= 1000; return ast_safe_sleep(chan, ms); } return 0; @@ -4985,8 +4985,8 @@ static int pbx_builtin_waitexten(struct ast_channel *chan, void *data) ast_moh_start(chan, opts[0]); /* Wait for "n" seconds */ - if (args.timeout && atof(args.timeout)) - ms = atof(args.timeout) * 1000; + if (args.timeout && (ms = atof(args.timeout)) > 0) + ms *= 1000; else if (chan->pbx) ms = chan->pbx->rtimeout * 1000; else