- dpi = strtol(resource, &endptr, 10);
- if (dpi == LONG_MAX || dpi == LONG_MIN || dpi < 0 || *endptr != '\0' || endptr == resource) {
+ double in_dpi = strtod(resource, &endptr);
+ if (in_dpi == HUGE_VAL || dpi < 0 || *endptr != '\0' || endptr == resource) {