Module Name: src Committed By: mrg Date: Mon Feb 4 09:53:41 UTC 2019
Modified Files: src/usr.sbin/mmcformat: mmcformat.c Log Message: - don't make -h/-H get around the argument check by setting 'inquiry' in the fallthru case, but instead explicitly check for 'display_usage' as well. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/mmcformat/mmcformat.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/mmcformat/mmcformat.c diff -u src/usr.sbin/mmcformat/mmcformat.c:1.4 src/usr.sbin/mmcformat/mmcformat.c:1.5 --- src/usr.sbin/mmcformat/mmcformat.c:1.4 Sat Oct 19 17:16:37 2013 +++ src/usr.sbin/mmcformat/mmcformat.c Mon Feb 4 09:53:41 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: mmcformat.c,v 1.4 2013/10/19 17:16:37 christos Exp $ */ +/* $NetBSD: mmcformat.c,v 1.5 2019/02/04 09:53:41 mrg Exp $ */ /* * Copyright (c) 2006, 2008 Reinoud Zandijk @@ -765,6 +765,7 @@ main(int argc, char *argv[]) case 'h' : case 'H' : display_usage = 1; + break; case 'I' : inquiry = 1; break; @@ -792,10 +793,10 @@ main(int argc, char *argv[]) argv += optind; argc -= optind; - if ((!blank && !format && !grow_session && !grow_spare) && - (!expert && !inquiry)) { - fprintf(stderr, "%s : at least one of -B, -F, -G, -S, -X or -I " - "needs to be specified\n\n", progname); + if (!blank && !format && !grow_session && !grow_spare && + !expert && !inquiry && !display_usage) { + fprintf(stderr, "%s : at least one of -B, -F, -G, -h, -H -S, " + "-X or -I needs to be specified\n\n", progname); return usage(progname); }