misc: remove superfluous null pointer checks for optarg
This is only needed for optional arguments. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
This commit is contained in:
parent
619081cdab
commit
0caad87fdb
|
@ -235,8 +235,6 @@ static void parse_argv(int argc, char **argv, struct sinfo *pinfo)
|
|||
print_shells();
|
||||
exit(EXIT_SUCCESS);
|
||||
case 's':
|
||||
if (!optarg)
|
||||
usage(stderr);
|
||||
pinfo->shell = optarg;
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -1381,15 +1381,12 @@ int main(int argc, char *argv[])
|
|||
outmode = OUT_NEWLINE;
|
||||
break;
|
||||
case 'o':
|
||||
if (optarg) {
|
||||
if (*optarg == '=')
|
||||
optarg++;
|
||||
ncolumns = string_to_idarray(optarg,
|
||||
columns, ARRAY_SIZE(columns),
|
||||
column_name_to_id);
|
||||
if (ncolumns < 0)
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if (*optarg == '=')
|
||||
optarg++;
|
||||
ncolumns = string_to_idarray(optarg, columns,
|
||||
ARRAY_SIZE(columns), column_name_to_id);
|
||||
if (ncolumns < 0)
|
||||
return EXIT_FAILURE;
|
||||
opt_o = 1;
|
||||
break;
|
||||
case 'r':
|
||||
|
|
|
@ -107,7 +107,7 @@ parse_args(int argc, char **argv, struct hexdump *hex)
|
|||
case 'f':
|
||||
addfile(optarg, hex);
|
||||
break;
|
||||
case 'L':
|
||||
case 'L':
|
||||
colormode = UL_COLORMODE_AUTO;
|
||||
if (optarg)
|
||||
colormode = colormode_or_err(optarg,
|
||||
|
|
Loading…
Reference in New Issue