Messages in this thread | | | Date | Mon, 21 Aug 2017 14:50:37 +0300 | From | Dan Carpenter <> | Subject | Re: [PATCH] lib/cmdline.c: add to the get_options() documentation |
| |
On Mon, Aug 21, 2017 at 02:42:52PM +0400, Ilya Matveychikov wrote: > > > On Aug 21, 2017, at 1:46 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote: > > > > I wasn't sure how get_options() worked, so I looked at examples. And by > > sheer chance the first example I picked the only example which uses it > > incorrectly... I've added some comments that hopefully help. > > > > See also comments on my patch from Ben Hutchings: > https://patchwork.kernel.org/patch/9811617/
Ugh... The implementation of get_options() looks gnarly, yes. That affects the part of my comment which says:
+ * string. It stores the number of numbers as the first element in the + * array.
If we are going to keep the current behavior then we should specify that ints[0] can be higher than "nints - 1". But I feel like the current behavior is wrong and that get_range() should never return more than n.
regards, dan carpenter
| |