]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
configutl.c: Remove dead code
authorNorbert Pocs <norbertp@openssl.org>
Wed, 14 May 2025 12:53:31 +0000 (14:53 +0200)
committerNeil Horman <nhorman@openssl.org>
Thu, 15 May 2025 19:38:10 +0000 (15:38 -0400)
Resolve coverity issue 16468481646847

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27623)

apps/configutl.c

index 9c6a2518c2aab2725140fa0374cddd19ce7851d5..81bcf9d7895a5f47de2bd8d72cfc960cdea660f8 100644 (file)
@@ -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;