btrfs-progs: search argument from index 1 in get_unit_mode_from_arg
diff mbox

Message ID 7581bd31c1787563bd77b8cad97f06afdb5f56de.1441358234.git.zhaolei@cn.fujitsu.com
State New
Headers show

Commit Message

Zhaolei Sept. 4, 2015, 1:24 p.m. UTC
No need to search arg[0] in get_unit_mode_from_arg(), because
argv[0] is always command name like: "btrfs filesystem df".

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
---
 utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox

diff --git a/utils.c b/utils.c
index ed1fb13..e086e23 100644
--- a/utils.c
+++ b/utils.c
@@ -3000,7 +3000,7 @@  unsigned int get_unit_mode_from_arg(int *argc, char *argv[], int df_mode)
 	int arg_i;
 	int arg_end;
 
-	for (arg_i = 0; arg_i < *argc; arg_i++) {
+	for (arg_i = 1; arg_i < *argc; arg_i++) {
 		if (!strcmp(argv[arg_i], "--raw")) {
 			unit_mode = UNITS_RAW;
 			argv[arg_i] = NULL;