From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 8A15458DF for ; Wed, 27 Jul 2016 13:27:27 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 27 Jul 2016 04:27:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,429,1464678000"; d="scan'208";a="1003437080" Received: from dpdk2.bj.intel.com ([172.16.182.189]) by orsmga001.jf.intel.com with ESMTP; 27 Jul 2016 04:27:25 -0700 From: Wei Dai To: dev@dpdk.org Cc: Wei Dai Date: Wed, 27 Jul 2016 19:25:56 +0800 Message-Id: <1469618756-144196-1-git-send-email-wei.dai@intel.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1469526749-19698-1-git-send-email-wei.dai@intel.com> References: <1469526749-19698-1-git-send-email-wei.dai@intel.com> Subject: [dpdk-dev] [PATCH v3 3/4] eal: fix tail blank check in --lcores argument X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2016 11:27:28 -0000 the tail blank after a group of lcore or cpu set will make check of its end character fail. for example: --lcores '(0-3)@(0-3) ,(4-5)@(4-5)', the next character after cpu set (0-3) is not ',' or '\0', which fail the check in eal_parse_lcores( ). Fixes: 53e54bf81700 ("eal: new option --lcores for cpu assignment") Signed-off-by: Wei Dai --- lib/librte_eal/common/eal_common_options.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index 217d08b..1a1bab3 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -530,6 +530,13 @@ eal_parse_set(const char *input, uint16_t set[], unsigned num) str = end + 1; } while (*end != '\0' && *end != ')'); + /* + * to avoid failure that tail blank makes end character check fail + * in eal_parse_lcores( ) + */ + while (isblank(*str)) + str++; + return str - input; } -- 2.5.5