diff --git a/getopt_long.c b/getopt_long.c index 5ce9bfd..c47215f 100644 --- a/getopt_long.c +++ b/getopt_long.c @@ -287,7 +287,7 @@ parse_long_options(char * const *nargv, const char *options, * XXX: GNU sets pkg_optopt to val regardless of flag */ if (long_options[match].flag == NULL) - pkg_optopt = long_options[match].val; + pkg_optopt = (int)long_options[match].val; else pkg_optopt = 0; #ifdef GNU_COMPATIBLE @@ -327,7 +327,7 @@ parse_long_options(char * const *nargv, const char *options, * XXX: GNU sets pkg_optopt to val regardless of flag */ if (long_options[match].flag == NULL) - pkg_optopt = long_options[match].val; + pkg_optopt = (int)long_options[match].val; else pkg_optopt = 0; --pkg_optind; @@ -360,7 +360,7 @@ parse_long_options(char * const *nargv, const char *options, #endif return (0); } else - return (long_options[match].val); + return ((int)long_options[match].val); } /*