Re: [PATCH] seq_buf: Introduce DECLARE_SEQ_BUF and seq_buf_cstr()

From: Matthew Wilcox
Date: Fri Oct 27 2023 - 06:43:58 EST


On Thu, Oct 26, 2023 at 10:54:26AM -0700, Kees Cook wrote:
> > > do_soemthing(seq_buf_cstr(s));
> >
> > Do we really need to call it _cstr? Why not just have seq_buf_str() ?
> >
> > I mean, this is C, do we need to state that in the name too?
>
> I'm fine either way. I did that just to make the distinction between our
> length-managed string of characters interface (seq_buf), and the
> %NUL-terminated string of characters (traditionally called "C String" in
> other languages). And it was still shorter than "seq_buf_terminate(s);
> s->buffer" ;)

'cstr' might be short for 'counted string' ...