The if() statement always evaluated to true. Detected by "cppcheck", not tested on real hardware.
Signed-off-by: Thomas Jarosch <[email protected]> --- drivers/rhino.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/rhino.c b/drivers/rhino.c index ca66169..e478bcb 100644 --- a/drivers/rhino.c +++ b/drivers/rhino.c @@ -187,7 +187,7 @@ AutonomyCalc( int ia ) /* all models */ { currin = ( UtilPowerOut + ConstInt ) *1.0 / Vin; auton = ( ( ( AmpH *1.0 / currin ) * 60 * ( ( BattVoltage - VbatMin ) * 1.0 /( VbatNom - VbatMin ) ) * FM ) + FA ); - if( ( BattVoltage > 129 ) || ( BattVoltage < 144 ) ) + if( ( BattVoltage > 129 ) && ( BattVoltage < 144 ) ) result = 133; else result = (int) auton; -- 1.7.4.4 _______________________________________________ Nut-upsdev mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsdev
