From patchwork Fri Sep 4 13:24:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhaolei X-Patchwork-Id: 7122771 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2BE9A9F32B for ; Fri, 4 Sep 2015 13:31:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 43AFA204AD for ; Fri, 4 Sep 2015 13:31:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F70E2046F for ; Fri, 4 Sep 2015 13:31:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758699AbbIDN06 (ORCPT ); Fri, 4 Sep 2015 09:26:58 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:65288 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S933110AbbIDN0M (ORCPT ); Fri, 4 Sep 2015 09:26:12 -0400 X-IronPort-AV: E=Sophos;i="5.15,520,1432569600"; d="scan'208";a="100347680" Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 04 Sep 2015 21:29:12 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id t84DQ066030048 for ; Fri, 4 Sep 2015 21:26:00 +0800 Received: from localhost.localdomain (10.167.226.114) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server id 14.3.181.6; Fri, 4 Sep 2015 21:26:10 +0800 From: Zhao Lei To: CC: Zhao Lei Subject: [PATCH] btrfs-progs: search argument from index 1 in get_unit_mode_from_arg Date: Fri, 4 Sep 2015 21:24:34 +0800 Message-ID: <7581bd31c1787563bd77b8cad97f06afdb5f56de.1441358234.git.zhaolei@cn.fujitsu.com> X-Mailer: git-send-email 1.8.5.1 MIME-Version: 1.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;