- timeout = strtol (value, &endptr, 0);
-
- if ((endptr == value) || (0 != errno))
- status = -1;
- else if (0 >= timeout)
- timeout = -1;
+ endptr = NULL;
+ timeout = strtod (opt_value, &endptr);
+
+ if ((endptr == opt_value) || (errno != 0) || (!isfinite (timeout)))
+ {
+ print_to_socket (fh, "-1 Invalid value for option `timeout': "
+ "%s\n", opt_value);
+ sfree (plugins);
+ sfree (identifiers);
+ return (-1);
+ }
+ else if (timeout < 0.0)
+ {
+ timeout = 0.0;
+ }