diff options
Diffstat (limited to 'funcs/func_timeout.c')
-rw-r--r-- | funcs/func_timeout.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/funcs/func_timeout.c b/funcs/func_timeout.c index 2f282b336..77d7c297e 100644 --- a/funcs/func_timeout.c +++ b/funcs/func_timeout.c @@ -84,6 +84,7 @@ static int timeout_write(struct ast_channel *chan, const char *cmd, char *data, const char *value) { double x; + long sec; char timestr[64]; struct ast_tm myt; struct timeval tv; @@ -99,10 +100,12 @@ static int timeout_write(struct ast_channel *chan, const char *cmd, char *data, if (!value) return -1; - if ((sscanf(value, "%ld%lf", (long *)&tv.tv_sec, &x) == 0) || tv.tv_sec < 0) + if ((sscanf(value, "%ld%lf", &sec, &x) == 0) || sec < 0) tv.tv_sec = 0; - else + else { + tv.tv_sec = sec; tv.tv_usec = x * 1000000; + } switch (*data) { case 'a': |