[Privoxy-devel] privoxy-3.0.27-stable bug report

Fabian Keil fk at fabiankeil.de
Sun Dec 30 14:02:03 UTC 2018


David Binderman <dcb314 at hotmail.com> wrote:

> privoxy-3.0.27-stable/jcc.c:2525]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses.
> 
> Source code is
> 
>                   if (write_socket_delayed(csp->cfd, hdr, hdrlen, write_delay)
>                    || ((flushed = flush_iob(csp->cfd, csp->iob, write_delay) < 0)
>                    || (write_socket_delayed(csp->cfd, csp->receive_buffer,
>                          (size_t)len, write_delay))))
>                   {
> 
> Maybe better code
> 
>                   if (write_socket_delayed(csp->cfd, hdr, hdrlen, write_delay)
>                    || ((flushed = flush_iob(csp->cfd, csp->iob, write_delay)) < 0
>                    || (write_socket_delayed(csp->cfd, csp->receive_buffer,
>                          (size_t)len, write_delay))))
>                   {

Thanks a lot for the timely report. I changed it to:

                  if (write_socket_delayed(csp->cfd, hdr, hdrlen, write_delay)
                   || ((flushed = flush_iob(csp->cfd, csp->iob, write_delay)) < 0)
                   || write_socket_delayed(csp->cfd, csp->receive_buffer,
                         (size_t)len, write_delay))

Which compiler did you use to get the error?

Fabian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.privoxy.org/pipermail/privoxy-devel/attachments/20181230/ed46ba3b/attachment.bin>


More information about the Privoxy-devel mailing list