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;
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