[Nut-upsdev] nut-2.6.5:rhino.c:190: bad if test ?

David Binderman dcb314 at hotmail.com
Tue Oct 8 08:30:36 UTC 2013


Hello there,

Offending source code is

      if(  ( BattVoltage> 129 ) || ( BattVoltage < 144 ) )

Maybe swap || for && would be better.

This problem I found by using cppcheck. It said

[rhino.c:190]: (warning) Logical disjunction always evaluates to true: BattVoltage> 129 || BattVoltage < 144.

Regards

David Binderman 		 	   		  


More information about the Nut-upsdev mailing list