[dpdk-dev] [PATCH v2] examples/pipeline: support CLI hex args

Dumitrescu, Cristian cristian.dumitrescu at intel.com
Wed Mar 24 13:52:47 CET 2021



> -----Original Message-----
> From: David Marchand <david.marchand at redhat.com>
> Sent: Wednesday, March 24, 2021 12:31 PM
> To: Khangar, Churchill <churchill.khangar at intel.com>
> Cc: dev <dev at dpdk.org>; Dumitrescu, Cristian
> <cristian.dumitrescu at intel.com>; P, Venkata Suresh Kumar
> <venkata.suresh.kumar.p at intel.com>; Jangra, Yogesh
> <yogesh.jangra at intel.com>
> Subject: Re: [dpdk-dev] [PATCH v2] examples/pipeline: support CLI hex args
> 
> On Wed, Mar 24, 2021 at 1:20 PM Churchill Khangar
> <churchill.khangar at intel.com> wrote:
> >
> > This patch allows specification of integer arguments for the
> > CLI commands in hexadecimal and octal as well as decimal.
> >
> > Signed-off-by: Churchill Khangar <churchill.khangar at intel.com>
> > Acked-by: Cristian Dumitrescu <cristian.dumitrescu at intel.com>
> > ---
> >  examples/pipeline/cli.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c
> > index ae06658..ef49eb8 100644
> > --- a/examples/pipeline/cli.c
> > +++ b/examples/pipeline/cli.c
> > @@ -55,7 +55,7 @@
> >         if (!isdigit(*p))
> 
> Not directly related to this change, but the isdigit() check is
> probably useless.
> strtoul returns the first invalid char.
> 

Yes, correct, more improvements could be made, we'll put it on the to-do list. Thanks, David.

> >                 return -EINVAL;
> >
> > -       val = strtoul(p, &next, 10);
> > +       val = strtoul(p, &next, 0);
> 
> 
> --
> David Marchand



More information about the dev mailing list