set: Remove a broken array read

Hardcode "--erase" as a hack, because "argv[-1]" is *not* a thing.

Introduced in aacc71e585.

Fixed in master by no longer being C++.
This commit is contained in:
Fabian Boehm 2024-01-01 15:11:43 +01:00
parent be0ea9862c
commit 20d36cd9a2

View File

@ -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) { 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); builtin_print_error_trailer(parser, streams.err, cmd);
return STATUS_INVALID_ARGS; return STATUS_INVALID_ARGS;
} }