Index: funcs/func_timeout.c =================================================================== --- funcs/func_timeout.c (revision 166053) +++ funcs/func_timeout.c (working copy) @@ -83,11 +83,12 @@ static int timeout_write(struct ast_channel *chan, const char *cmd, char *data, const char *value) { - double x; + double x = 0.0; long sec; char timestr[64]; struct ast_tm myt; struct timeval when; + int res; if (!chan) return -1; @@ -100,11 +101,15 @@ if (!value) return -1; - if ((sscanf(value, "%ld%lf", &sec, &x) == 0) || sec < 0) + if ((res = sscanf(value, "%ld%lf", &sec, &x) == 0) || sec < 0) when.tv_sec = 0; else { when.tv_sec = sec; - when.tv_usec = x * 1000000; + if (res == 1) { + when.tv_usec = 0; + } else { + when.tv_usec = x * 1000000; + } } switch (*data) {