From: Zhao Lei <zhaolei@cn.fujitsu.com>
To: <linux-btrfs@vger.kernel.org>
Cc: Zhao Lei <zhaolei@cn.fujitsu.com>
Subject: [PATCH 3/5] btrfs-progs: Avoid using uninitialized optind in cmd_rescue_zero_log
Date: Fri, 4 Sep 2015 21:24:17 +0800 [thread overview]
Message-ID: <ec5de1a7a0e4e46cd0b51e5fb63f39a69325cf31.1441357933.git.zhaolei@cn.fujitsu.com> (raw)
In-Reply-To: <cover.1441357933.git.zhaolei@cn.fujitsu.com>
Better to avoid using optind in cmd_rescue_zero_log(), because no
getopt() before.
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
---
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
next prev parent reply other threads:[~2015-09-04 13:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-04 13:24 [PATCH 0/5] btrfs-progs: Introduce --extra-dev option Zhao Lei
2015-09-04 13:24 ` [PATCH 1/5] " Zhao Lei
2015-09-04 13:24 ` [PATCH 2/5] btrfs-progs: Support extra-dev for btrfs rescue Zhao Lei
2015-09-04 13:24 ` Zhao Lei [this message]
2015-09-04 13:24 ` [PATCH 4/5] btrfs-progs: add help command to btrfs rescue zero-log Zhao Lei
2015-09-04 13:24 ` [PATCH 5/5] btrfs-progs: update manual for --extra-dev and -h for btrfs rescue Zhao Lei
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ec5de1a7a0e4e46cd0b51e5fb63f39a69325cf31.1441357933.git.zhaolei@cn.fujitsu.com \
--to=zhaolei@cn.fujitsu.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).