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


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.  It's not available everywhere,
but, gnulib has a strchrnul module that fixes that.

Thanks,
Pedro Alves


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