From: Ruediger Meier Date: Tue, 20 Jun 2017 09:50:20 +0000 (+0200) Subject: dmesg: do not accept any non-option arguments X-Git-Tag: v2.31-rc1~268^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=488a21686f0d8a614f0dfe3f8884ace61bf2eccd;p=thirdparty%2Futil-linux.git 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 --- diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c index b83cfb1bb5..5be4ff6087 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) ||