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.
--
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)