bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wget-1.21: 3 * suspicious conditions ?


From: Darshit Shah
Subject: Re: wget-1.21: 3 * suspicious conditions ?
Date: Sun, 3 Jan 2021 16:01:25 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0

Hi,

Thanks for the heads up. The expression is indeed more complex than it
should be. I've made some more elaborate changes than you suggested to
fix and simplify these expressions

On 03.01.21 09:21, David Binderman wrote:
> Hello there,
> 
> wget-1.21/src/retr.c:1445:10: style: Suspicious condition (assignment + 
> comparison); Clarify expression with parentheses. [clarifyCondition]
> wget-1.21/src/retr.c:1447:15: style: Suspicious condition (assignment + 
> comparison); Clarify expression with parentheses. [clarifyCondition]
> wget-1.21/src/retr.c:1454:6: style: Suspicious condition (assignment + 
> comparison); Clarify expression with parentheses. [clarifyCondition]
> 
> The first one is
> 
>       if ((overflow = ((unsigned) snprintf (to, sizeof (to), "%s%s%d", fname, 
> SEP, i)) >= sizeof (to)))
> 
> Maybe better code
> 
>       if ((overflow = ((unsigned) snprintf (to, sizeof (to), "%s%s%d", fname, 
> SEP, i))) >= sizeof (to))
> 
> Regards
> 
> David Binderman
> 
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]