Re: [PATCH v2 6/7] string-list: optionally omit empty string pieces in string_list_split*()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Patrick Steinhardt <ps@xxxxxx> writes:

>> +	if ((flags & STRING_LIST_SPLIT_NONEMPTY) && (end <= p))
>> +		return 0;
>
> Okay, this is where the return value of `append_one()` starts to make
> sense.
>
> The condition for `end <= p` is probably overly defensive, as it
> shouldn't ever happen that `end < p`. We could make that a `BUG()`, but
> I'm not sure that's really worth it.

Correct.  I'd leave it to be defensive but without overly
pessimistic BUG, as this is a leaf function that, once carefully
vetted, is unlikely to become buggy (which is famous last words).




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux