diff --git a/usr.bin/elfctl/elfctl.c b/usr.bin/elfctl/elfctl.c --- a/usr.bin/elfctl/elfctl.c +++ b/usr.bin/elfctl/elfctl.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -249,13 +250,13 @@ if (i == len) { if (isdigit(feature[0])) { char *eptr; - long val; + unsigned long long val; errno = 0; - val = strtol(feature, &eptr, 0); + val = strtoll(feature, &eptr, 0); if (eptr == feature || *eptr != '\0') errno = EINVAL; - else if (val > UINT_MAX) + else if (val > UINT32_MAX) errno = ERANGE; if (errno != 0) { warn("%s invalid", feature);