On Sun, Oct 14, 2018 at 04:03:48PM +0100, Ramsay Jones wrote:
> > So I kind of wonder if a comment would be better than xsize_t here.
> > Something like:
> >
> > if (avail > len) {
> > /*
> > * This can never truncate because we know that len is smaller
> > * than avail, which is already a size_t.
> > */
> > avail = (size_t)len;
> > }
>
> Heh, you are, of course, correct! (that will learn me[1]). :-D
>
> Hmm, let's see if I can muster the enthusiasm to do all that
> testing again!
For the record, I am not opposed to including the comment _and_ using
xsize_t() to do the cast, giving us an assertion that the comment is
correct.
-Peff