On 2026-06-20 22:48:38 +0200, Alejandro Colomar via Mutt-dev wrote:
> Hi Vincent,
> 
> On 2026-06-20T19:39:29+0200, Vincent Lefevre wrote:
> > On 2026-06-18 11:28:00 +0800, Kevin J. McCarthy wrote:
> > > In this case, I think the proposed patch is the best solution:
> > > 
> > > diff --git a/rfc2047.c b/rfc2047.c
> > > index d72ae997..2bdd8553 100644
> > > --- a/rfc2047.c
> > > +++ b/rfc2047.c
> > > @@ -815,7 +815,7 @@ static size_t lwslen(const char *s, size_t n)
> > >        len = (size_t)(p - s);
> > >        break;
> > >      }
> > > -  if (strchr("\r\n", *(p-1))) /* LWS doesn't end with CRLF */
> > > +  if (len > 0 && strchr("\r\n", *(p-1))) /* LWS doesn't end with CRLF */
> > >      len = (size_t)0;
> > >    return len;
> > >  }
> > 
> > "len = (size_t)0;" has a cast, but "len > 0" doesn't.
> > This doesn't matter much, but this is not consistent.
> 
> Comparison with a literal should not use casts.

OK here, but why is there a cast for the assignment, then?

If the cast is useless for the comparison, then it should also
be useless for the assignment.

-- 
Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)

Reply via email to