Skip to content

Commit

Permalink
set: Remove a broken array read
Browse files Browse the repository at this point in the history
Hardcode "--erase" as a hack, because "argv[-1]" is *not* a thing.

Introduced in aacc71e.

Fixed in master by no longer being C++.
  • Loading branch information
faho committed Jan 1, 2024
1 parent be0ea98 commit 20d36cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/builtins/set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ static int validate_cmd_opts(const wchar_t *cmd, const set_cmd_opts_t &opts, int
}

if (argc == 0 && opts.erase) {
streams.err.append_format(BUILTIN_ERR_MISSING, cmd, argv[-1]);
streams.err.append_format(BUILTIN_ERR_MISSING, cmd, L"--erase");
builtin_print_error_trailer(parser, streams.err, cmd);
return STATUS_INVALID_ARGS;
}
Expand Down

0 comments on commit 20d36cd

Please sign in to comment.