Probable boolean logic error
Michael McConville <[email protected]>
| Newsgroups | gmane.comp.audio.mp3.lame |
|---|---|
| Message-ID | <20160415045353.GA29193@thinkpad> |
Currently, these conditions can never be true. It seems like || was
meant to be used instead of &&.
Thanks for your time,
Michael
--- misc/abx.c
+++ /tmp/cocci-output-38249-eb5652-abx.c
@@ -745,7 +745,7 @@ void testing ( const stereo_t* A, const
fprintf (stderr, " Vote for X:=A" );
eval ( rnd == 0 );
rnd = random_number ();
- if ( state == 6 && state == 7 )
+ if ( state == 6 || state == 7 )
state = 6 + rnd;
else if ( state != rnd )
state = rnd + 2;
@@ -756,7 +756,7 @@ void testing ( const stereo_t* A, const
fprintf (stderr, " Vote for X:=B" );
eval ( rnd == 1 );
rnd = random_number ();
- if ( state == 6 && state == 7 )
+ if ( state == 6 || state == 7 )
state = 6 + rnd;
else if ( state != rnd )
state = rnd + 2;
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z