From: Karel Zak Date: Fri, 14 May 2010 11:04:50 +0000 (+0200) Subject: fallocate: check for number of arguments X-Git-Tag: v2.18-rc1~104 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fd1ee3b92e08b17a67099371e647da54632b2f8a;p=thirdparty%2Futil-linux.git fallocate: check for number of arguments Signed-off-by: Karel Zak --- diff --git a/sys-utils/fallocate.c b/sys-utils/fallocate.c index e41643a2ff..d1f43c2425 100644 --- a/sys-utils/fallocate.c +++ b/sys-utils/fallocate.c @@ -122,6 +122,11 @@ int main(int argc, char **argv) fname = argv[optind++]; + if (optind != argc) { + warnx(_("unexpected number of arguments")); + usage(stderr); + } + fd = open(fname, O_WRONLY|O_CREAT, 0644); if (fd < 0) err(EXIT_FAILURE, _("%s: open failed"), fname);