diff --git a/funcs/func_timeout.c b/funcs/func_timeout.c index 37b441127e..f327e7608a 100644 --- a/funcs/func_timeout.c +++ b/funcs/func_timeout.c @@ -89,7 +89,6 @@ static int timeout_read(struct ast_channel *chan, char *cmd, char *data, static int timeout_write(struct ast_channel *chan, char *cmd, char *data, const char *value) { - float f; int x; char timestr[64]; struct tm myt; @@ -105,10 +104,9 @@ static int timeout_write(struct ast_channel *chan, char *cmd, char *data, if (!value) return -1; - f = atof(value); - if (f < 0) - f = 1.0; - x = (int) (f * 1000); + x = atoi(value); + if (x < 0) + x = 0; switch (*data) { case 'a':