|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v4 01/53] xen: add an optional string end parameter to parse_bool()
On 24/08/17 17:33, Jan Beulich wrote:
>>>> On 23.08.17 at 19:33, <jgross@xxxxxxxx> wrote:
>> @@ -163,20 +163,24 @@ void __init cmdline_parse(const char *cmdline)
>> #endif
>> }
>>
>> -int __init parse_bool(const char *s)
>> +int __init parse_bool(const char *s, const char *e)
>> {
>> - if ( !strcmp("no", s) ||
>> - !strcmp("off", s) ||
>> - !strcmp("false", s) ||
>> - !strcmp("disable", s) ||
>> - !strcmp("0", s) )
>> + unsigned int len;
>> +
>> + len = e ? e - s : strlen(s);
>
> If you don't mind, I'd like to see ASSERT(e >= s) added to the middle
> part here; should be easily doable while committing.
Sure, NP.
Juergen
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |