For options that do not take arguments, the "arg" member of the help
structure is not assigned by lopt_get_help. Since the structure
is not otherwise initialized, it is technically undefined to even
evaluate this member in order to pass it to the help_print_option
function.
In this case, the argument is not actually used, and I'm not aware
of any actual failures as a result, but it easy enough to avoid.
static void print_help(const struct option *lopts)
{
+ struct lopt_help help = {0};
const struct option *opt;
print_usage(stdout);
puts(_("Options:"));
for (opt = lopts; opt->name; opt++) {
- struct lopt_help help;
-
if (!lopt_get_help(opt, &help))
continue;