[PATCH 3/5] btrfs-progs: Avoid using uninitialized optind in cmd_rescue_zero_log

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Better to avoid using optind in cmd_rescue_zero_log(), because no
getopt() before.

Signed-off-by: Zhao Lei <zhaolei@xxxxxxxxxxxxxx>
---
 cmds-rescue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmds-rescue.c b/cmds-rescue.c
index 163d0bb..a709e1b 100644
--- a/cmds-rescue.c
+++ b/cmds-rescue.c
@@ -182,7 +182,7 @@ int cmd_rescue_zero_log(int argc, char **argv)
 	if (check_argc_exact(argc, 2))
 		usage(cmd_rescue_zero_log_usage);
 
-	devname = argv[optind];
+	devname = argv[1];
 	ret = check_mounted(devname);
 	if (ret < 0) {
 		fprintf(stderr, "Could not check mount status: %s\n", strerror(-ret));
-- 
1.8.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux