aboutsummaryrefslogtreecommitdiff
path: root/src/tool_getparam.c
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2013-04-30 14:23:39 +0000
committerDaniel Stenberg <daniel@haxx.se>2013-07-14 23:04:05 +0200
commitd8c04909fa50e87bba58311dd8feecaa94508f4b (patch)
treedc2cd13dd737e087906275d2ab73da190fbea777 /src/tool_getparam.c
parentc0a7a98aee6e0be77949f310ea81c253e3d1c6c5 (diff)
src/tool: allow timeouts to accept decimal values
Implement wrappers around strtod to convert the user argument to a double with sane error checking. Use this to allow --max-time and --connect-timeout to accept decimal values instead of strictly integers. The manpage is updated to make mention of this feature and, additionally, forewarn that the actual timeout of the operation can vary in its precision (particularly as the value increases in its decimal precision).
Diffstat (limited to 'src/tool_getparam.c')
-rw-r--r--src/tool_getparam.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tool_getparam.c b/src/tool_getparam.c
index fb8270894..5eb2c9f83 100644
--- a/src/tool_getparam.c
+++ b/src/tool_getparam.c
@@ -498,7 +498,7 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
GetStr(&config->egd_file, nextarg);
break;
case 'c': /* connect-timeout */
- err = str2unum(&config->connecttimeout, nextarg);
+ err = str2udouble(&config->connecttimeout, nextarg);
if(err)
return err;
break;
@@ -1404,7 +1404,7 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
break;
case 'm':
/* specified max time */
- err = str2unum(&config->timeout, nextarg);
+ err = str2udouble(&config->timeout, nextarg);
if(err)
return err;
break;