summaryrefslogtreecommitdiffstats
path: root/sys-utils/dmesg.c
diff options
context:
space:
mode:
authorRuediger Meier2017-06-20 11:50:20 +0200
committerRuediger Meier2017-06-22 21:34:43 +0200
commit488a21686f0d8a614f0dfe3f8884ace61bf2eccd (patch)
tree135a022d92f1c95c9b575db562d0ff5bb8dc3bdf /sys-utils/dmesg.c
parentblkid: use errtryhelp instead of errtryh (diff)
downloadkernel-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.c4
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) ||