On Wed, 21 Apr 2021 09:17:17 +0800
"Min Hu (Connor)" <humi...@huawei.com> wrote:

>               idx = strtoul(corelist, &end, 10);
>               if (errno || end == NULL)
>                       return -1;
> +             if (idx < 0 || idx >= RTE_MAX_LCORE)

Wondered at first how strtoul() could ever return an negative value but then
noticed that idx is int here.

The code that does would be clearer and safer if the variables were an unsigned
type. idx, min, max should be the same type everywhere.

Looks like the original code was written in old C style of "all the world's an 
int"

Reply via email to