[asterisk-commits] russell: trunk r80540 - in /trunk: ./ funcs/func_timeout.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Aug 23 14:22:49 CDT 2007


Author: russell
Date: Thu Aug 23 14:22:49 2007
New Revision: 80540

URL: http://svn.digium.com/view/asterisk?view=rev&rev=80540
Log:
Merged revisions 80539 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r80539 | russell | 2007-08-23 14:21:53 -0500 (Thu, 23 Aug 2007) | 4 lines

Fix func_timeout to take values in floating point so 1.5 actually means
1.5 seconds instead of being rounded.
(closes issue #10540, reported by spendergrass, patch by me)

........

Modified:
    trunk/   (props changed)
    trunk/funcs/func_timeout.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/funcs/func_timeout.c
URL: http://svn.digium.com/view/asterisk/trunk/funcs/func_timeout.c?view=diff&rev=80540&r1=80539&r2=80540
==============================================================================
--- trunk/funcs/func_timeout.c (original)
+++ trunk/funcs/func_timeout.c Thu Aug 23 14:22:49 2007
@@ -90,6 +90,7 @@
 static int timeout_write(struct ast_channel *chan, const char *cmd, char *data,
 			 const char *value)
 {
+	float f;
 	int x;
 	char timestr[64];
 	struct ast_tm myt;
@@ -105,7 +106,10 @@
 	if (!value)
 		return -1;
 
-	x = atoi(value);
+	f = atof(value);
+	if (f < 0)
+		f = 1.0;
+	x = (int) (f * 1000);
 
 	switch (*data) {
 	case 'a':




More information about the asterisk-commits mailing list