| 207 | |
| 208 | static float parse_float_range(const char *s, const char *opt, float min, float max) { |
| 209 | char *end = NULL; |
| 210 | float v = strtof(s, &end); |
| 211 | if (s[0] == '\0' || *end != '\0' || !isfinite(v) || v < min || v > max) { |
| 212 | fprintf(stderr, "ds4: invalid value for %s: %s\n", opt, s); |
| 213 | exit(2); |
| 214 | } |
no test coverage detected