From 4074ae5f2bac71889527e817ddeee5fd85a3ba59 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Wed, 8 Apr 2015 17:33:55 +0200 Subject: btrfs-progs: cleanup option index argument from getopt_long We're not using it anywhere. The best practice is to add enums with values > 255 for the long options, option index counting is error prone. Signed-off-by: David Sterba --- cmds-filesystem.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'cmds-filesystem.c') diff --git a/cmds-filesystem.c b/cmds-filesystem.c index f3fc160c..188dbf0c 100644 --- a/cmds-filesystem.c +++ b/cmds-filesystem.c @@ -208,7 +208,7 @@ static int cmd_filesystem_df(int argc, char **argv) unsigned unit_mode = UNITS_DEFAULT; while (1) { - int long_index; + int c; static const struct option long_options[] = { { "raw", no_argument, NULL, 'b'}, { "kbytes", no_argument, NULL, 'k'}, @@ -221,8 +221,8 @@ static int cmd_filesystem_df(int argc, char **argv) GETOPT_VAL_HUMAN_READABLE}, { NULL, 0, NULL, 0 } }; - int c = getopt_long(argc, argv, "bhHkmgt", long_options, - &long_index); + + c = getopt_long(argc, argv, "bhHkmgt", long_options, NULL); if (c < 0) break; switch (c) { @@ -836,14 +836,14 @@ static int cmd_show(int argc, char **argv) int found = 0; while (1) { - int long_index; + int c; static const struct option long_options[] = { { "all-devices", no_argument, NULL, 'd'}, { "mounted", no_argument, NULL, 'm'}, { NULL, 0, NULL, 0 } }; - int c = getopt_long(argc, argv, "dm", long_options, - &long_index); + + c = getopt_long(argc, argv, "dm", long_options, NULL); if (c < 0) break; switch (c) { -- cgit v1.2.3