From: Milan Broz Date: Fri, 17 Dec 2010 22:36:55 +0000 (+0100) Subject: wipefs: fail if more device arguments specified X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ebe8f630ad8f31cd0aca0636f73eb9b4ffe5aa2;p=util-linux 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 --- 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) {