David Binderman
2017-Aug-24 18:39 UTC
dovecot-2.2.32/src/doveadm/doveadm-mail-fetch.c: 4 * suspicious expression ?
Hello there, dovecot-2.2.32/src/doveadm/doveadm-mail-fetch.c:130]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses. Source code is if ((ret = doveadm_print_istream(input) < 0)) Maybe better code if ((ret = doveadm_print_istream(input)) < 0) Some duplicates: [dovecot-2.2.32/src/doveadm/doveadm-mail-fetch.c:220]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses. [dovecot-2.2.32/src/doveadm/doveadm-mail-fetch.c:237]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses. [dovecot-2.2.32/src/doveadm/doveadm-mail-fetch.c:261]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses. Regards David Binderman
Aki Tuomi
2017-Aug-29 06:36 UTC
dovecot-2.2.32/src/doveadm/doveadm-mail-fetch.c: 4 * suspicious expression ?
On 2017-08-24 21:39, David Binderman wrote:> Hello there, > > dovecot-2.2.32/src/doveadm/doveadm-mail-fetch.c:130]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses. > > Source code is > > if ((ret = doveadm_print_istream(input) < 0)) > > Maybe better code > > if ((ret = doveadm_print_istream(input)) < 0) > > Some duplicates: > > [dovecot-2.2.32/src/doveadm/doveadm-mail-fetch.c:220]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses. > [dovecot-2.2.32/src/doveadm/doveadm-mail-fetch.c:237]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses. > [dovecot-2.2.32/src/doveadm/doveadm-mail-fetch.c:261]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses. > > Regards > > David BindermanThank you, we'll take a look. Aki
Aki Tuomi
2017-Aug-29 08:49 UTC
dovecot-2.2.32/src/doveadm/doveadm-mail-fetch.c: 4 * suspicious expression ?
On 2017-08-24 21:39, David Binderman wrote:> Hello there, > > dovecot-2.2.32/src/doveadm/doveadm-mail-fetch.c:130]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses. > > Source code is > > if ((ret = doveadm_print_istream(input) < 0)) > > Maybe better code > > if ((ret = doveadm_print_istream(input)) < 0) > > Some duplicates: > > [dovecot-2.2.32/src/doveadm/doveadm-mail-fetch.c:220]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses. > [dovecot-2.2.32/src/doveadm/doveadm-mail-fetch.c:237]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses. > [dovecot-2.2.32/src/doveadm/doveadm-mail-fetch.c:261]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses. > > Regards > > David BindermanHi! This is already fixed in master commit d9a7e950a9cd21f2b4a90ec7759fca9e8fcc7995 Author: Timo Sirainen <timo.sirainen at dovecot.fi> Date: Sun Jun 5 15:37:06 2016 +0300 global: Fixed mismatched bool vs. int/pointer handling I don't think these fix any actual bugs. Aki