From: Ruediger Meier <ruediger.meier@xxxxxxxxxxx> This is only needed for optional arguments. Signed-off-by: Ruediger Meier <ruediger.meier@xxxxxxxxxxx> --- login-utils/chsh.c | 2 -- login-utils/lslogins.c | 15 ++++++--------- text-utils/hexdump.c | 2 +- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/login-utils/chsh.c b/login-utils/chsh.c index 3bea971..10b0bdc 100644 --- a/login-utils/chsh.c +++ b/login-utils/chsh.c @@ -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: diff --git a/login-utils/lslogins.c b/login-utils/lslogins.c index ab04c10..1e89d27 100644 --- a/login-utils/lslogins.c +++ b/login-utils/lslogins.c @@ -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': diff --git a/text-utils/hexdump.c b/text-utils/hexdump.c index 125734d..bf06316 100644 --- a/text-utils/hexdump.c +++ b/text-utils/hexdump.c @@ -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, -- 1.8.5.6 -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html