Re: [PATCH bpf-next v4 1/2] selftests/bpf: implement setting global variables in veristat

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2025-02-24 at 16:38 -0800, Andrii Nakryiko wrote:

[...]

> > +       } else if (*val == '-' || isdigit(*val)) {
> 
> instead of doing this detection based on characters, why not try to
> parse a number (and I'd use sscanf("%lli") which will handle 1234 and
> 0x1234 transparently)? And you can use %n to check that all characters
> were parsed (i.e., you have exact match)
> 
> it's probably fine for starters, but it kind of sucks that 0x1234
> isn't supported

(Nit: {strtoull,strtoll}(val, NULL, 0) supports decimal and hexadecimal notations).

[...]






[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux