From 677ded7547351bc3b1b6f72745e84b1287402ffb Mon Sep 17 00:00:00 2001 From: Norbert Pocs Date: Wed, 14 May 2025 14:53:31 +0200 Subject: [PATCH] configutl.c: Remove dead code MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Resolve coverity issue 1646848, 1646847 Signed-off-by: Norbert Pocs Reviewed-by: Saša Nedvědický Reviewed-by: Neil Horman Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/27623) --- apps/configutl.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/apps/configutl.c b/apps/configutl.c index 9c6a2518c2a..81bcf9d7895 100644 --- a/apps/configutl.c +++ b/apps/configutl.c @@ -111,7 +111,6 @@ int configutl_main(int argc, char *argv[]) int ret = 1; char *prog, *configfile = NULL; OPTION_CHOICE o; - int dump = 1; CONF *cnf = NULL; long eline = 0; int default_section_idx, idx; @@ -123,11 +122,6 @@ int configutl_main(int argc, char *argv[]) prog = opt_init(argc, argv, configutl_options); while ((o = opt_next()) != OPT_EOF) { switch (o) { - case OPT_EOF: - case OPT_ERR: - opthelp: - BIO_printf(bio_err, "%s: Use -help for summary.\n", prog); - goto end; case OPT_HELP: opt_help(configutl_options); ret = 0; @@ -142,12 +136,16 @@ int configutl_main(int argc, char *argv[]) case OPT_OUT: outfile = opt_arg(); break; + case OPT_ERR: + /* + * default needed for OPT_EOF which might never happen. + */ + default: + BIO_printf(bio_err, "%s: Use -help for summary.\n", prog); + goto end; } } - if (dump == 0) - goto opthelp; - out = bio_open_default(outfile, 'w', FORMAT_TEXT); if (out == NULL) goto end; -- 2.47.2