Hi Tao,
On Mon, Dec 08, 2025 at 09:18:38AM +1300, Tao Liu wrote:
I suggest replacing 3072, cause it is a magic number here, people
may
be curious where 3072 comes from. How about the following:
else if (STREQ(long_options[option_index].name, "max-malloc-bufs")) {
int tmp = atoi(optarg);
MAX_MALLOC_BUFS = tmp > MAX_MALLOC_BUFS ? tmp : MAX_MALLOC_BUFS;
}
Maybe tmp is not a good name, but just illustrate my idea.
How about the following
MAX_MALLOC_BUFS = max(atoi(optarg), MAX_MALLOC_BUFS);
then we can define a simple max function in tools.c perhaps?
```
int max(int a, int b) {
if (a > b) return a;
return b;
}
```
~Shivang.