[dpdk-dev] [PATCH] app/testpmd: fix support of hex string parser for flow API

Stephen Hemminger stephen at networkplumber.org
Mon Mar 18 16:27:07 CET 2019


On Fri, 15 Mar 2019 16:43:55 +0800
Wei Zhao <wei.zhao1 at intel.com> 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?


More information about the dev mailing list