From fd1ee3b92e08b17a67099371e647da54632b2f8a Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 14 May 2010 13:04:50 +0200 Subject: [PATCH] fallocate: check for number of arguments Signed-off-by: Karel Zak --- sys-utils/fallocate.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys-utils/fallocate.c b/sys-utils/fallocate.c index e41643a2..d1f43c24 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); -- 2.39.5