]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - apps/enc.c
APPS: Improve diagnostics on missing/extra args and unknown cipher/digest
[thirdparty/openssl.git] / apps / enc.c
index 3dd609856304eed7c4090e0d55e94ecd0ac94397..e71453c3c4adcb81b5bfb34ae0d08c301d0405f8 100644 (file)
@@ -289,17 +289,14 @@ int enc_main(int argc, char **argv)
     }
 
     /* No extra arguments. */
-    argc = opt_num_rest();
-    if (argc != 0)
+    if (!opt_check_rest_arg(NULL))
         goto opthelp;
     if (!app_RAND_load())
         goto end;
 
     /* Get the cipher name, either from progname (if set) or flag. */
-    if (ciphername != NULL) {
-        if (!opt_cipher(ciphername, &cipher))
-            goto opthelp;
-    }
+    if (!opt_cipher(ciphername, &cipher))
+        goto opthelp;
     if (digestname != NULL) {
         if (!opt_md(digestname, &dgst))
             goto opthelp;