From 6ebe8f630ad8f31cd0aca0636f73eb9b4ffe5aa2 Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Fri, 17 Dec 2010 23:36:55 +0100 Subject: [PATCH] wipefs: fail if more device arguments specified Currently wipefs process only first device argument and silently ignores remaining. Print error instead because it can be quite confusing. Signed-off-by: Milan Broz Signed-off-by: Karel Zak --- misc-utils/wipefs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/misc-utils/wipefs.c b/misc-utils/wipefs.c index d3033446..4ab36159 100644 --- a/misc-utils/wipefs.c +++ b/misc-utils/wipefs.c @@ -384,6 +384,9 @@ main(int argc, char **argv) fname = argv[optind++]; + if (optind != argc) + errx(EXIT_FAILURE, _("only one device as argument is currently supported.")); + wp = read_offsets(wp, fname, all); if (wp) { -- 2.39.5