Ed Maste wrote:
> diff --git a/usr.bin/elfctl/elfctl.c b/usr.bin/elfctl/elfctl.c
> index 20a2c5b95444..f641b63e32bd 100644
> --- a/usr.bin/elfctl/elfctl.c
> +++ b/usr.bin/elfctl/elfctl.c
> @@ -245,9 +247,26 @@ convert_to_feature_val(char *feature_str, uint32_t 
> *feature_val)
>                       }
>               }
>               if (i == len) {
> -                     warnx("%s is not a valid feature", feature);
> -                     if (!iflag)
> -                             return (false);
> +                     if (isdigit(feature[0])) {
> +                             char *eptr;
> +                             long val;
> +
> +                             errno = 0;
> +                             val = strtol(feature, &eptr, 0);
> +                             if (eptr == feature || *eptr != '\0')
> +                                     errno = EINVAL;
> +                             else if (val > UINT_MAX)
> +                                     errno = ERANGE;
> +                             if (errno != 0) {
> +                                     warn("%s invalid", feature);
> +                                     return (false);
> +                             }
> +                             input != val;
> +                     } else {
> +                             warnx("%s is not a valid feature", feature);
> +                             if (!iflag)
> +                                     return (false);
> +                     }
>               }
>       }
>  
Build fails:

--- elfctl.o ---
/usr/src/usr.bin/elfctl/elfctl.c:264:11: error: inequality comparison
result unused [-Werror,-Wunused-comparison]
                                input != val;
                                ~~~~~~^~~~~~
/usr/src/usr.bin/elfctl/elfctl.c:264:11: note: use '|=' to turn this
inequality comparison into an or-assignment
                                input != val;
                                      ^~
                                      |=
1 error generated.
*** [elfctl.o] Error code 1

make[4]: stopped in /usr/src/usr.bin/elfctl

-- 
Charlie Li
…nope, still don't have an exit line.

(This email address is for mailing list use; replace local-part with
vishwin for off-list communication if possible)

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to