From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH] app/testpmd: fix support of hex string parser for flow API Date: Mon, 18 Mar 2019 08:27:07 -0700 Message-ID: <20190318082707.1dfb60d7@shemminger-XPS-13-9360> References: <1552639435-68184-1-git-send-email-wei.zhao1@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, stable@dpdk.org, qi.z.zhang@intel.com, adrien.mazarguil@6wind.com To: Wei Zhao Return-path: Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) by dpdk.org (Postfix) with ESMTP id BEACA324D for ; Mon, 18 Mar 2019 16:27:11 +0100 (CET) Received: by mail-pg1-f181.google.com with SMTP id i7so8412703pgq.0 for ; Mon, 18 Mar 2019 08:27:11 -0700 (PDT) In-Reply-To: <1552639435-68184-1-git-send-email-wei.zhao1@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, 15 Mar 2019 16:43:55 +0800 Wei Zhao wrote: > + /* Check input parameters */ > + if ((src == NULL) || > + (dst == NULL) || > + (size == NULL) || > + (*size == 0)) > + return -1; > + if ((*size & 1) != 0) > + return -1; > + > + for (c = src, i = 0; i < *size; c++, i++) { > + if ((((*c) >= '0') && ((*c) <= '9')) || > + (((*c) >= 'A') && ((*c) <= 'F')) || > + (((*c) >= 'a') && ((*c) <= 'f'))) > + continue; > + Excessive number of parens here. You don't need them around (*c) Why did you not use isxdigit() instead?