diff mbox

[3/3] btrfs-progs: use check_argc_exact to check arg number of btrfs-rescue

Message ID 1400117349-2851-3-git-send-email-guihc.fnst@cn.fujitsu.com (mailing list archive)
State Accepted
Delegated to: David Sterba
Headers show

Commit Message

Gui Hecheng May 15, 2014, 1:29 a.m. UTC
The btrfs-rescue accepts exactly one arg for both
chunk-recover & super-recover, use check_argc_exact clearly.
---
 cmds-rescue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/cmds-rescue.c b/cmds-rescue.c
index 9491d0c..3629141 100644
--- a/cmds-rescue.c
+++ b/cmds-rescue.c
@@ -85,7 +85,7 @@  int cmd_chunk_recover(int argc, char *argv[])
 	}
 
 	argc = argc - optind;
-	if (argc == 0)
+	if (check_argc_exact(argc, 1))
 		usage(cmd_chunk_recover_usage);
 
 	file = argv[optind];
@@ -141,7 +141,7 @@  int cmd_super_recover(int argc, char **argv)
 		}
 	}
 	argc = argc - optind;
-	if (argc != 1)
+	if (check_argc_exact(argc, 1))
 		usage(cmd_super_recover_usage);
 
 	dname = argv[optind];