From 2620c38ba8f9bd4ceffd124e12e2a630621abe27 Mon Sep 17 00:00:00 2001 From: "Dr. David von Oheimb" Date: Tue, 26 May 2020 10:44:10 +0200 Subject: [PATCH] Remove meanwhile redundant error output of apps/opt_next(void) parsing numbers Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/11998) --- apps/lib/opt.c | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/apps/lib/opt.c b/apps/lib/opt.c index 566de8ab7d..7630d516ca 100644 --- a/apps/lib/opt.c +++ b/apps/lib/opt.c @@ -740,40 +740,29 @@ int opt_next(void) break; case 'p': case 'n': - if (!opt_int(arg, &ival) - || (o->valtype == 'p' && ival <= 0)) { + if (!opt_int(arg, &ival)) + return -1; + if (o->valtype == 'p' && ival <= 0) { opt_printf_stderr("%s: Non-positive number \"%s\" for -%s\n", prog, arg, o->name); return -1; } break; case 'M': - if (!opt_imax(arg, &imval)) { - opt_printf_stderr("%s: Invalid number \"%s\" for -%s\n", - prog, arg, o->name); + if (!opt_imax(arg, &imval)) return -1; - } break; case 'U': - if (!opt_umax(arg, &umval)) { - opt_printf_stderr("%s: Invalid number \"%s\" for -%s\n", - prog, arg, o->name); + if (!opt_umax(arg, &umval)) return -1; - } break; case 'l': - if (!opt_long(arg, &lval)) { - opt_printf_stderr("%s: Invalid number \"%s\" for -%s\n", - prog, arg, o->name); + if (!opt_long(arg, &lval)) return -1; - } break; case 'u': - if (!opt_ulong(arg, &ulval)) { - opt_printf_stderr("%s: Invalid number \"%s\" for -%s\n", - prog, arg, o->name); + if (!opt_ulong(arg, &ulval)) return -1; - } break; case 'c': case 'E': -- 2.25.1