8 long int GetInt(const char* param
)
15 result
= strtol(param
, &endptr
, 10);
18 /* Win64 has even more broken behavior, it returns -1 on range error */
19 if ((errno
== ERANGE
&& (result
== LONG_MAX
|| result
== LONG_MIN
|| result
== -1))) {
21 /* Windows do not report correctly errno */
22 if (result
== LONG_MAX
|| result
== LONG_MIN
) {
24 if ((errno
== ERANGE
&& (result
== LONG_MAX
|| result
== LONG_MIN
))) {
26 printf_err(_("Number out of range: %s\n"), param
);
30 if (*endptr
!= '\0') {
31 printf_err(_("Parameter is not a number: %s\n"), param
);