Remove meanwhile redundant error output of apps/opt_next(void) parsing numbers
@@ -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':
