From 488a21686f0d8a614f0dfe3f8884ace61bf2eccd Mon Sep 17 00:00:00 2001 From: Ruediger Meier Date: Tue, 20 Jun 2017 11:50:20 +0200 Subject: dmesg: do not accept any non-option arguments 'dmesg foo' is no valid syntax and gives an error now. BTW we avoid the "dead increment of argc and argv. Signed-off-by: Ruediger Meier --- sys-utils/dmesg.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sys-utils/dmesg.c') diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c index b83cfb1bb..5be4ff608 100644 --- a/sys-utils/dmesg.c +++ b/sys-utils/dmesg.c @@ -1486,10 +1486,8 @@ int main(int argc, char *argv[]) errtryhelp(EXIT_FAILURE); } } - argc -= optind; - argv += optind; - if (argc > 1) + if (argc != optind) usage(stderr); if ((is_timefmt(&ctl, RELTIME) || -- cgit v1.2.3-55-g7522