Skip to content

Commit

Permalink
From patchwork series 434662
Browse files Browse the repository at this point in the history
  • Loading branch information
Fox Snowpatch committed Nov 29, 2024
1 parent a85c72f commit 887c6f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions arch/powerpc/boot/wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ pseries)
link_address='0x4000000'
if [ "$format" != "elf32ppc" ]; then
link_address=
notext='-z notext'
pie=-pie
fi
make_space=n
Expand Down
10 changes: 5 additions & 5 deletions tools/lib/subcmd/parse-options.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,7 @@ static int parse_short_opt(struct parse_opt_ctx_t *p, const struct option *optio
return -2;
}

static int parse_long_opt(struct parse_opt_ctx_t *p, const char *arg,
const struct option *options)
static int parse_long_opt(struct parse_opt_ctx_t *p, const char *arg, const struct option *options)
{
const char *arg_end = strchr(arg, '=');
const struct option *abbrev_option = NULL, *ambiguous_option = NULL;
Expand Down Expand Up @@ -828,9 +827,10 @@ static struct option *options__order(const struct option *opts)

nr_parent = nr_opts;
}
/* copy the last OPTION_END */
memcpy(&ordered[nr_opts], o, sizeof(*o));

/* Check whether o is valid before using it to copy the last OPTION_END. */
if (o && o->type == OPTION_END) {
memcpy(&ordered[nr_opts], o, sizeof(*o));
}
/* sort each option group individually */
for (opt = group = ordered; opt->type != OPTION_END; opt++) {
if (opt->type == OPTION_GROUP) {
Expand Down

0 comments on commit 887c6f4

Please sign in to comment.