On Mon, Dec 8, 2025 at 7:26 PM Shivang Upadhyay <[email protected]> wrote: > > 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; > }
OK, looking good, thank you! Thanks, Tao Liu > ``` > > ~Shivang. > > -- Crash-utility mailing list -- [email protected] To unsubscribe send an email to [email protected] https://${domain_name}/admin/lists/devel.lists.crash-utility.osci.io/ Contribution Guidelines: https://github.com/crash-utility/crash/wiki
