From: openocd-gerrit <ope...@us...> - 2025-01-25 10:34:33
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 778d2dc4bb982ffa00f5fbd343346555fcbf9113 (commit) from 0b97973bfbb980f987ec8e0e8d8ad32c85e9e5b0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 778d2dc4bb982ffa00f5fbd343346555fcbf9113 Author: Evgeniy Naydanov <evg...@sy...> Date: Fri Jan 17 18:03:40 2025 +0300 helper/options: drop redundant argument checks In case the option is passed with a single `:` in `optstring` argument, the call to `getopt_long()` should return `?`. Therefore the check on `optarg` is redundand in case of `l` and `c`. Change-Id: I1ac176fdae449a34db0a0496b69a9ea65ccd6aec Signed-off-by: Evgeniy Naydanov <evg...@sy...> Reported-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8718 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/helper/options.c b/src/helper/options.c index 61a101469..9e332cc8c 100644 --- a/src/helper/options.c +++ b/src/helper/options.c @@ -303,12 +303,10 @@ int parse_cmdline_args(struct command_context *cmd_ctx, int argc, char *argv[]) break; } case 'l': /* --log_output | -l */ - if (optarg) - command_run_linef(cmd_ctx, "log_output %s", optarg); + command_run_linef(cmd_ctx, "log_output %s", optarg); break; case 'c': /* --command | -c */ - if (optarg) - add_config_command(optarg); + add_config_command(optarg); break; default: /* '?' */ /* getopt will emit an error message, all we have to do is bail. */ ----------------------------------------------------------------------- Summary of changes: src/helper/options.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) hooks/post-receive -- Main OpenOCD repository |