This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Introduce skip_to_char and use it


Pedro Alves <palves@redhat.com> writes:

> On 01/27/2016 01:32 AM, Sergio Durigan Junior wrote:
>
>> The problem with skip_to_char IMO is that it leads the reader to believe
>> that this function performs the same job as strchr (in fact, my first
>> reaction when I read this introduction was to think "why not use
>> strchr?").  The main difference, however, is that this function actually
>> skips everything if the char was not found.
>> 
>> I believe a name like "skip_to_char_or_nul" may be more appropriate.
>> What do you think?
>
> That sounds just like strchrnul, though.

Or strcspn.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]