diff options
author | Ruediger Meier | 2017-06-20 11:50:20 +0200 |
---|---|---|
committer | Ruediger Meier | 2017-06-22 21:34:43 +0200 |
commit | 488a21686f0d8a614f0dfe3f8884ace61bf2eccd (patch) | |
tree | 135a022d92f1c95c9b575db562d0ff5bb8dc3bdf /sys-utils/dmesg.c | |
parent | blkid: use errtryhelp instead of errtryh (diff) | |
download | kernel-qcow2-util-linux-488a21686f0d8a614f0dfe3f8884ace61bf2eccd.tar.gz kernel-qcow2-util-linux-488a21686f0d8a614f0dfe3f8884ace61bf2eccd.tar.xz kernel-qcow2-util-linux-488a21686f0d8a614f0dfe3f8884ace61bf2eccd.zip |
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 <ruediger.meier@ga-group.nl>
Diffstat (limited to 'sys-utils/dmesg.c')
-rw-r--r-- | sys-utils/dmesg.c | 4 |
1 files changed, 1 insertions, 3 deletions
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) || |